Modal form is shown behind form with fsSystemStayOnTop, locking out user.
Original Reporter info from Mantis: dezlov
-
Reporter name: Denis Kozlov
Original Reporter info from Mantis: dezlov
- Reporter name: Denis Kozlov
Description:
TForm.FormStyle and TForm.ShowModal can produce conflicting behavior and in some circumstances result in application being locked out from the user.
Particularly, in CASE A2, a modal form is always shown behind another form with fsSystemStayOnTop style, preventing access to the model form and the application.
I've compared behavior of several test cases between Lazarus, Delphi 7 and 2010. Results are in the "Steps To Reproduce" section.
Steps to reproduce:
CASE A SETUP:
Form1.FormStyle := fsSystemStayOnTop; // fsStayOnTop in Delphi
Form2.FormStyle := fsNormal;
CASE A1: Form2.Show
* Lazarus 1.2.4: Form2 shown behind Form1, always stays behind.
* Delphi 7: Form2 shown behind Form1, always stays behind.
* Delphi 2010: Form2 shown infront of Form1, always stays infront.
CASE A2: Form2.ShowModal
* Lazarus 1.2.4: Form2 shown behind Form1, always stays behind. // locked out!!!
* Delphi 7: Form2 shown infront Form1, always stays infront.
* Delphi 2010: Form2 shown behind Form1, always stays behind. // locked out!!!
CASE B SETUP:
Form1.FormStyle := fsSystemStayOnTop;
Form2.FormStyle := fsStayOnTop;
CASE B1: Form2.Show
* Lazarus: Form2 shown infront of Form1, whichever is focused is infront.
CASE B2: Form2.ShowModal
* Lazarus: Form2 shown infront of Form1, always stays infront.
CASE C SETUP:
Form1.FormStyle := fsStayOnTop;
Form2.FormStyle := fsNormal;
CASE C1: Form2.Show
* Lazarus: Form2 shown behind Form1, always stays behind.
CASE C2: Form2.ShowModal
* Lazarus: Form2 shown infront Form1, always stays infront.