Thank you very much wp for this demo. I feel sad because not you should spend your valuable time for creating a demo. And despite there are some differences to what I wrote the problem occurs in your demo in the same way as in my real program. This is great!
So where can be the reason, that the problem did not occur on your system?
I use Linux Ubuntu 24.04 64-bit on KDE-Desktop with X11 Window manager.
I compiled your demo with:
- Lazarus/FPC 3.4.0/3.2.2 (gtk2 and qt5)
- my last trunk from summer 2024 = Lazarus 3.99 (rev main_3_99-2316-g00f3d3b397) FPC 3.3.1 x86_64-linux-gtk2
- Lazarus/FPC 2.0.10/3.2.0 (gtk2 only)
and always the problem occured the same way.
I have a friend with Ubuntu 24.04 and Gnome-Desktop. Will try to contact and ask him to test your demo there. If this is not possible in the nearer time I will install Lazarus 4.4 and try there.
Here again a detailed description, how the problem occurs with your demo on my system:
- in MainForm press the only button to open modal Form1 (it's named Form2, don't worry)
- in Form1 press button "2" to open non modal Form2
- now I can click on both Forms as often as I want and always the clicked Form gets the Focus and I can use it without any restrictions (I can both Forms resize, move, minimize, maximize and close)
- in Form1 press button "3" to open non modal Form3, which hides Form1 temporarily and after some seconds closes Form3 automatically and shows Form1 again
From now on I cannot set the Focus (via mouse) to still open Form2 any longer:
- the Focus then always stays on Form1
- I cannot close Form2 (via it's Icon in upper right corner)
- but I can still resize, move, minimize and maximize Form2
- and if I cover Form2 partly by another Window (with the MainForm of the demo or a Window of another program), then by clicking on Form2 it comes to front (but without getting the Focus).
As said, this problem does not occur on Windows.
Above behavior of Form2 is exactly the same behavior, which I described in reply #8 (marked there in blue), if a program first opens a non modal Form2 and after that opens a modal Form5.
Again my question from there: Is it possible, that the problem occurs, because (after modal Form1 was temporarily hidden) the program "thinks", that a new modal Form was opened (because it behaves that way)?
Can you (or someone else) reproduce the problem with above description on Linux?
If yes/no, please tell us your detailed OS- and Lazarus version.