FormStyle=fsStayOnTop makes form unresponsive
Original Reporter info from Mantis: Hansaplast
-
Reporter name: Hans Luijten
Original Reporter info from Mantis: Hansaplast
- Reporter name: Hans Luijten
Description:
Not sure how to explain this, so I'll illustrate it based on a test project (attached);
I have a main form, which opens when the application opens, as with most Lazarus applications.
On that form I have a button that allows me to open another form (ShowModal), Form2 (just a normal form -default settings).
On Form2 I have yet another button, which allows me to open a 3rd form - Form3.
Form3 has FormStyle set to fsStayOnTop, everything else are the default values.
Because the FormStyle is set to fsStayOnTop (same with fsSystemStayOntop), this form now is not responding to mouse or keyboard, not even in the "systemmenu" responds (eg. the "X" to close the window). None of the controls (incl. buttons) on Form3 respond to mouse or keyboard..
Note: When changing Form3.FormStyle to fsNormal; everything is OK. The form just doesn't stay on top (obviously).
However, when adding another button to the mainform, which opens yet another form (Form4), also set to fsStayOntop, then everything works as expected. Form4 stays on top, controls respond to mouse an keyboard.
I have tested this example project under Windows and MacOS, and with both of them all forms work as expected. Just under Linux (GTK2), Form3 does not respond to anything, as if the entire form is disabled.
Steps to reproduce:
Please see attached example project.
All forms were create with their default settings, except Form3 and Form4 where FormStyle was set to fsStayOnTop (fsSystemStayOnTop causes the same issue).
The project has a 4th form, in order to test what happens if another form is opened straight from the mainform (then the problem does not occur).
Long version:
Create a form. Place a button on the form.
Create another form. Add this new form to the uses of the first form, and set the button to open the second form with ShowModal.
Add a button to the second form.
Create a 3rd form, set Formstyle to fsStayOnTop.
Add Form3 to the uses of Form2.
Set the button on form2 to open Form3.
Add a button to Form3.
Run the application.
Click on the button 1st Form, so the second form opens.
Click the button on the 2nd form, so the 3rd form open.
Try clicking anything on the 3rd form, try to close the form. It doesn't work.
Additional information:
Lazarus 1.9.0 r58991 FPC 3.0.4 x86_64-linux-gtk2
Mantis conversion info:
- Mantis ID: 34280
- OS: Mint Linux
- OS Build: Ubuntu Bionic
- Build: r58991
- Platform: Linux
- Version: 1.8.5 (SVN)
- Monitored by: » Hansaplast (Hans Luijten)