Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2016-02

Question about modal forms behaviour under windows

16 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

zeljko

Hi all,
I don't use windows, so don't know what exact behaviour should be. Now: MainForm + One modal form, minimizing modal form does not minimize mainform (application). (tested with win32 and qt-win32 widgetsets)

X11: Minimizing modal form minimizes complete application. (qt, gtk2)

My question is: What's exact behaviour of Delphi apps under windows in this case ?

zeljko

Reply by email

Graeme Geldenhuys
to zeljko
zeljko wrote
X11: Minimizing modal form minimizes complete application. (qt, gtk2)

Well, under X11 it is hard to find an application with a modal dialog to start with. Modal dialogs are considered very bad design (read the book "About Face 4th edition"). With every application I tested, there simply wasn't a minimize button to click, only a "X" (close) button.

Under Windows, modal dialogs are much more common (about the only platform where that is true). In all cases, the modal dialog (like X11) doesn't have a minimize or maximize button, only a "x" (close) button.

In both platforms I tested with applications not written in LCL. eg: The Gimp, Pluma editor, Adobe Reader, Total Commander, EditPad Pro etc.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp

Reply by email

zeljko
to Graeme Geldenhuys
Graeme Geldenhuys wrote 11 lines
On 2016-02-08 08:02, zeljko wrote: > X11: Minimizing modal form minimizes complete application. (qt, gtk2) Well, under X11 it is hard to find an application with a modal dialog to start with. Modal dialogs are considered very bad design (read the book "About Face 4th edition"). With every application I tested, there simply wasn't a minimize button to click, only a "X" (close) button. Under Windows, modal dialogs are much more common (about the only platform where that is true). In all cases, the modal dialog (like X11) doesn't have a minimize or maximize button, only a "x" (close) button.

Actually, LCL applications (Delphi also) CAN HAVE minimize button on modal form, so that's exact point of my question.
Simplified what to do:

1.Leave it as it is - minimized modal form does not minimize app (pretty bad, since you cannot access desktop if your mainform is maximized)

2.Change default behaviour - minimized modal form minimizes complete app. I like how it works under X11 .... eg minimizing Lazarus About dialog under KDE kwin, minimizes complete app, clicking on app in tray, restores app.

zeljko

Reply by email

Denis Kozlov
to zeljko: I don't use windows, so don't know what exact behaviour should be. Now: MainForm + One…

There is a long standing bug report about this particular topic: 0026463: Application minimize not working with modal forms http://bugs.freepascal.org/view.php?id=26463

*Issue 1*: Application.Minimize should always minimize the entire application, including modal forms. Currently, the modal form will get squashed into a corner while other disabled windows will keeping hanging on the desktop.

*Issue 2*: Minimizing a modal form, provided that it has the minimize button enabled, should call Application.Minimize with the effect as described in Issue 1.

This is my opinion (as a software developer with 15 years experience).

Denis

zeljko wrote 12 lines
Hi all, I don't use windows, so don't know what exact behaviour should be. Now: MainForm + One modal form, minimizing modal form does not minimize mainform (application). (tested with win32 and qt-win32 widgetsets) X11: Minimizing modal form minimizes complete application. (qt, gtk2) My question is: What's exact behaviour of Delphi apps under windows in this case ? zeljko

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20160208/be2bb6ec/attachment.html>

Reply by email

Ondrej Pokorny
to zeljko: Actually, LCL applications (Delphi also) CAN HAVE minimize button on modal form, so…
zeljko wrote
2.Change default behaviour - minimized modal form minimizes complete app. I like how it works under X11 .... eg minimizing Lazarus About dialog under KDE kwin, minimizes complete app, clicking on app in tray, restores app.

Delphi does the same - if you hit minimize on a modal form, it minimizes the whole application. IMO this is the only correct way.

Ondrej

Reply by email

Graeme Geldenhuys
to zeljko: I don't use windows, so don't know what exact behaviour should be. Now: MainForm + One…

Hi,

[mailing list: strangely, I get replies to zeljko's message, yet haven't seen zeljko's reply yet (and no, I don't have spam filters set up). I had to copy the quote text below from the Lazarus archives.]

zeljko wrote
Actually, LCL applications (Delphi also) CAN HAVE minimize button on modal form, so that's exact point of my question. Simplified what to do:

I didn't mean it is not possible, I meant it is not normally done - for good reason.

1.Leave it as it is - minimized modal form does not minimize app (pretty bad, since you cannot access desktop if your mainform is maximized)

Indeed, that is bad.

2.Change default behaviour - minimized modal form minimizes complete app. I like how it works under X11 .... eg minimizing Lazarus About dialog under KDE kwin, minimizes complete app, clicking on app in tray, restores app.

Ah, we got to love LCL consistency. [NOT] Lazarus v1.7 About dialog under LCL-GTK2 (on my JWM desktop environment), there is no minimize button. The about dialog only has a Maximize (????) and a Close button.

Either way, I agree with point 2. If modal dialogs have a minimize button, the only sane behaviour would be to minimise the whole application, and then restore the whole application and all windows/dialogs when needed.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp

Reply by email

zeljko
to Ondrej Pokorny: Delphi does the same - if you hit minimize on a modal form, it minimizes the whole…
Ondrej Pokorny wrote 8 lines
On 08.02.2016 10:46, zeljko wrote: > 2.Change default behaviour - minimized modal form minimizes complete > app. I like how it works under X11 .... eg minimizing Lazarus About > dialog under KDE kwin, minimizes complete app, clicking on app in > tray, restores app. Delphi does the same - if you hit minimize on a modal form, it minimizes the whole application. IMO this is the only correct way.

Thanks Ondrej. That's exactly what I want to know. I'll open an issue about it, since it affects win32 and qt-win32 (tested last night with lazarus trunk, fpc-3.0.0 on windows7). Question is only where to implement this platform specific stuff, in ws or in LCL...maybe better place will be WS, but maybe someone have different idea.

zeljko

Reply by email

zeljko
to Graeme Geldenhuys: [mailing list: strangely, I get replies to zeljko's message, yet haven't seen zeljko's…
Graeme Geldenhuys wrote 8 lines
Ah, we got to love LCL consistency. [NOT] Lazarus v1.7 About dialog under LCL-GTK2 (on my JWM desktop environment), there is no minimize button. The about dialog only has a Maximize (????) and a Close button. Either way, I agree with point 2. If modal dialogs have a minimize button, the only sane behaviour would be to minimise the whole application, and then restore the whole application and all windows/dialogs when needed.

Graeme, such example IS NOT LCL consistency thing. Some window managers (eg JWM and xfce AFAIR) refuse to show minimize button on modal windows. Under kwin and metacity you can see minimize button if you enabled it.

zeljko

Reply by email

zeljko
to Denis Kozlov: There is a long standing bug report about this particular topic: 0026463: Application…
Denis Kozlov wrote 15 lines
There is a long standing bug report about this particular topic: 0026463: Application minimize not working with modal forms http://bugs.freepascal.org/view.php?id=26463 *Issue 1*: Application.Minimize should always minimize the entire application, including modal forms. Currently, the modal form will get squashed into a corner while other disabled windows will keeping hanging on the desktop. *Issue 2*: Minimizing a modal form, provided that it has the minimize button enabled, should call Application.Minimize with the effect as described in Issue 1. This is my opinion (as a software developer with 15 years experience).

Your opinion is correct. Thanks for the info, I'll assign that issue to my self and fix it soon.

zeljko

Reply by email

Graeme Geldenhuys
to zeljko: Graeme, such example IS NOT LCL consistency thing. Some window managers (eg JWM and xfce…
zeljko wrote
Some window managers (eg JWM and xfce AFAIR) refuse to show minimize button on modal windows.

I do fully understand that X11 window manager can decide to to show and what not to show....

But, fpGUI's modal dialogs show the minimize button under JWM. The same system I run Lazarus on. So this doesn't seem to be a window manager (JWM in this case) feature or issue.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp

Reply by email

zeljko
to Graeme Geldenhuys
Graeme Geldenhuys wrote 10 lines
On 2016-02-08 10:24, zeljko wrote: > Some window managers (eg JWM and xfce AFAIR) refuse to show minimize > button on modal windows. I do fully understand that X11 window manager can decide to to show and what not to show.... But, fpGUI's modal dialogs show the minimize button under JWM. The same system I run Lazarus on. So this doesn't seem to be a window manager (JWM in this case) feature or issue.

fpgui is using libX11, not gtk2 or qt afair, so rules are different.

zeljko

Reply by email

Graeme Geldenhuys
to zeljko
zeljko wrote
fpgui is using libX11, not gtk2 or qt afair, so rules are different.

All three speak to the same window manager in the end, and your argument was that some Window Managers don't adhere to such a request. Well, I just mentioned that JWM does adhere to such a request if it receives it.

From what you said, Lazarus's About dialog does have a Minimize button

defined, and is visible when Lazarus is run under KDE, but not visible when compiled with LCL-GTK2 and run under JWM. So somewhere something is getting lost. Now my fpGUI test application also defines a Minimise button for a modal dialog, and when run under JWM, the Minimize button is shown. So all in all, JWM adheres to the request to display a Minimize button. Now the question is, why doesn't it happen for Lazarus compiled with LCL-GTK2? I can only conclude that somewhere in LCL-GTK2's widgetset that information about the Minimize button is lost.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp

Reply by email

Denis Kozlov
to zeljko: Your opinion is correct. Thanks for the info, I'll assign that issue to my self and fix…

@zeljko

I've just tested your fixes in latest TRUNK on Windows 7 and it's looking good!

Have you considered changing the behaviour where the modal form is getting squashed into a corner when application gets minimized?

Instead of squashing every modal form into a corner of the desktop (as demonstrated on the screenshot below), it would be better to minimize them as non-modal forms, i.e. minimize into the taskbar with the main form. Do you think its feasible?

[image: Inline images 1]

zeljko wrote 23 lines
On 02/08/2016 11:00 AM, Denis Kozlov wrote: > > There is a long standing bug report about this particular topic: > 0026463: Application minimize not working with modal forms > http://bugs.freepascal.org/view.php?id=26463 > > *Issue 1*: Application.Minimize should always minimize the entire > application, including modal forms. Currently, the modal form will get > squashed into a corner while other disabled windows will keeping hanging > on the desktop. > > *Issue 2*: Minimizing a modal form, provided that it has the minimize > button enabled, should call Application.Minimize with the effect as > described in Issue 1. > > Your opinion is correct. Thanks for the info, I'll assign that issue to my self and fix it soon. zeljko

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20160226/8c6b16f0/attachment-0001.html> -------------- next part --------------
A non-text attachment was scrubbed...
Name: minimized-modal-forms.png
Type: image/png
Size: 21260 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20160226/8c6b16f0/attachment-0001.png>

Reply by email

Zeljko
to Denis Kozlov
Denis Kozlov wrote 12 lines
@zeljko I've just tested your fixes in latest TRUNK on Windows 7 and it's looking good! Have you considered changing the behaviour where the modal form is getting squashed into a corner when application gets minimized? Instead of squashing every modal form into a corner of the desktop (as demonstrated on the screenshot below), it would be better to minimize them as non-modal forms, i.e. minimize into the taskbar with the main form. Do you think its feasible?

It'll look better definitelly, but must study win api to get such behaviour. Note that qt and win32 behave in same way about modal windows, so maybe it is so on windows by default.

zeljko

Reply by email

Zeljko
to Denis Kozlov: @zeljko I've just tested your fixes in latest TRUNK on Windows 7 and it's looking good!…
Denis Kozlov wrote 12 lines
@zeljko I've just tested your fixes in latest TRUNK on Windows 7 and it's looking good! Have you considered changing the behaviour where the modal form is getting squashed into a corner when application gets minimized? Instead of squashing every modal form into a corner of the desktop (as demonstrated on the screenshot below), it would be better to minimize them as non-modal forms, i.e. minimize into the taskbar with the main form. Do you think its feasible?

Qt works :), but problematic part is win32 because of GetRealPopupParent. Simple test shows that creating handle of modalform with getDesktopWindow as parentWindow works fine ... I'll see how to implement that in LCL.

zeljko

Reply by email

Zeljko
to Denis Kozlov: @zeljko I've just tested your fixes in latest TRUNK on Windows 7 and it's looking good!…
Denis Kozlov wrote 12 lines
@zeljko I've just tested your fixes in latest TRUNK on Windows 7 and it's looking good! Have you considered changing the behaviour where the modal form is getting squashed into a corner when application gets minimized? Instead of squashing every modal form into a corner of the desktop (as demonstrated on the screenshot below), it would be better to minimize them as non-modal forms, i.e. minimize into the taskbar with the main form. Do you think its feasible?

I've opened issue about it http://bugs.freepascal.org/view.php?id=29744 , fix will come soon for qt and win32. Issue is opened so we can track possible regressions or other modal windows problems.

zeljko

Show quoted text 41 lines
Inline images 1 On 8 February 2016 at 10:25, zeljko < <mailto:>> wrote: On 02/08/2016 11:00 AM, Denis Kozlov wrote: There is a long standing bug report about this particular topic: 0026463: Application minimize not working with modal forms http://bugs.freepascal.org/view.php?id=26463 *Issue 1*: Application.Minimize should always minimize the entire application, including modal forms. Currently, the modal form will get squashed into a corner while other disabled windows will keeping hanging on the desktop. *Issue 2*: Minimizing a modal form, provided that it has the minimize button enabled, should call Application.Minimize with the effect as described in Issue 1. Your opinion is correct. Thanks for the info, I'll assign that issue to my self and fix it soon. zeljko -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email