Recent

Author Topic: ShowModal disables form minimise  (Read 6304 times)

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: ShowModal disables form minimise
« Reply #15 on: May 15, 2021, 06:09:39 pm »
Hi!


This is not a bug.
A car with square tyres will not roll.

ShowModal: This is the only Form which will react on any user action.  Meanwhile all other Forms are disabled..This is the defined and wanted behaviour. If you dont respect that your demo will not work.

Winni

« Last Edit: May 15, 2021, 06:14:33 pm by winni »

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: ShowModal disables form minimise
« Reply #16 on: May 15, 2021, 08:39:13 pm »
This is not a bug.
A car with square tyres will not roll.

ShowModal: This is the only Form which will react on any user action.  Meanwhile all other Forms are disabled..This is the defined and wanted behaviour. If you dont respect that your demo will not work.

That  is not the problem. The problem (bug?) is that if you have two forms and ShowModal a third, the one that was previously active will lose the minimize button and system menu item even after this third is closed.

It's not that the button (and menu item) is  disabled: it just dissapears!
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: ShowModal disables form minimise
« Reply #17 on: May 15, 2021, 09:39:13 pm »
Hi!

Just tested:

Lin64/gtk2 : No Problems
Win7/64 : No Problems

So I think it is again a Win10 problem.

Dont use that rubbish!

Winni

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: ShowModal disables form minimise
« Reply #18 on: May 15, 2021, 09:59:23 pm »
Well, I tested it on Linux-gtk/x86_64 (Xubuntu 18,04), so it doesn't seem to be "Windows-only". It might depend on specific versions of some libs, though, so some Linuxen show and other don't show this behaviour.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: ShowModal disables form minimise
« Reply #19 on: May 15, 2021, 11:21:57 pm »
Well, I tested it on Linux-gtk/x86_64 (Xubuntu 18,04), so it doesn't seem to be "Windows-only". It might depend on specific versions of some libs, though, so some Linuxen show and other don't show this behaviour.

Okay. Only tested with Suse Tumbleweed and the last gtk2 libs.

And yes: The titlebar and the system menu are job of the Window Manager and not of Lazarus. So there must be some trouble in the interface to the Window Manager.

And the Window Manager where a long time a problem. The height of the Linux Titlebar was a long time only available through some lousy tricks (including mine).

So this is a tricky item. And remember: You can change your Window Manager with Linux on the fly: After that you only have to restart you session.

Oh oh ....

Winni

dseligo

  • Hero Member
  • *****
  • Posts: 1177
Re: ShowModal disables form minimise
« Reply #20 on: May 16, 2021, 08:41:00 pm »
Hi!

Just tested:

Lin64/gtk2 : No Problems
Win7/64 : No Problems

So I think it is again a Win10 problem.

Dont use that rubbish!

Winni

It works fine on Win10.
I included test project (in case I didn't understand OP's problem).

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: ShowModal disables form minimise
« Reply #21 on: May 16, 2021, 09:57:02 pm »
I've modified a little dseligo's project so any of you can test more thorougly.

With this project (Xubuntu 18.04-x86_64 & Laz/FPC 2.0.12/3.2.0) this happens after you start the program:
  • Clicking inmediately on "Show form C" things work as they should (with the small caveat outlined below);
  • Clicking on "Show form B" and then clicking either A's or B's "Show form C" makes the clicked form loose its minimize button (image 1) and disable the items in the system menu, and it's not recovered after closing form C (image 2)
One further caveat: even though it's a "normal" one and all is set right, form C never displays a minimize button either.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

dseligo

  • Hero Member
  • *****
  • Posts: 1177
Re: ShowModal disables form minimise
« Reply #22 on: May 16, 2021, 11:00:59 pm »
I've modified a little dseligo's project so any of you can test more thorougly.

This still works fine on Windows 10.

tetrastes

  • Sr. Member
  • ****
  • Posts: 469
Re: ShowModal disables form minimise
« Reply #23 on: May 17, 2021, 12:33:46 am »
Some notes...
Have anybody noticed this?
I wonder whether this is why Lazarus itself cannot be minimized?
I can confirm that Lazarus IDE (gtk2 64 bit) main window loses its Minimize button after opening its other windows at Debian 10 x86_64 Xfce (but not KDE).
I think this is bug/feature of LCLgtk2 (maybe qt also - did not test) apps at Xfce (maybe Xfce on Debian/clones only).

Apps at Linux behave very differently on different distros, widgetsets, DE, WM...  %)
For example, at the moment I am at Fedora 32 x86-64 LXQt with OpenBox WM. And with this WM modal window does not fully disable its parent, it may be minimized, maximized and resized while modal window is opened. Moreover, for gtk2 (though I have not gtk2 apps other than LCLgtk2 including Lazarus here) you can switch between modal and non-modal windows (for example in Lazarus IDE or in dseligo's and lucamar's projects when you open all 3 forms).
There are many things with Lazarus and Linux... For example, I never managed Form's property Position poDefault, poDefaultPosOnly, poDefaultSizeOnly to work...
« Last Edit: May 17, 2021, 12:39:55 am by tetrastes »

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: ShowModal disables form minimise
« Reply #24 on: May 17, 2021, 01:03:17 am »
Have anybody noticed this?
I wonder whether this is why Lazarus itself cannot be minimized?
I can confirm that Lazarus IDE (gtk2 64 bit) main window loses its Minimize button after opening its other windows at Debian 10 x86_64 Xfce (but not KDE).

Yes, I noticed it too (because of this thread) in Xubuntu (Xcfe). In fact it happened (again) right after running the test project: after pressing the "Run" combo, most all the IDE windows (including the editor and the project forms) lost the minimize button :(

What is interesting is that in both a plain Ubuntu (gnome) and a Kubuntu (kde) boxes it doesn't happpen, so there must be something "fishy" going on with Xfce and, presumably, other desktops.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

 

TinyPortal © 2005-2018