Recent

Author Topic: [SOLVED] Main form TMainMenu enabled while another form is ShowModal  (Read 1439 times)

apeoperaio

  • Sr. Member
  • ****
  • Posts: 272
I encountered a wrong behaviour related to TMainMenu and modal forms.

I have a main form (Form1) with a TMainMenu. I open a second form (Form2) as ShowModal. The main menu items are properly disabled. But, if I exwecute a TSaveDialog on the second form (Form2) the main menu of the first form (Form1) becomes enabled.

The issue can be easily reproduced with the attached project.

Should I report it in the bug tracker?

Thanks.

Lazarus 2.0.11 r64142M FPC 3.2.0 x86_64-darwin-cocoa
« Last Edit: December 09, 2020, 10:54:13 am by apeoperaio »

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2020
  • Former Delphi 1-7, 10.2 user
Re: Main form TMainMenu enabled while another form is ShowModal
« Reply #1 on: November 26, 2020, 11:29:18 pm »
When a Mac app does need a user response before it can proceed, it normally uses a modal "sheet", not a modal dialog. A modal sheet does not block access to the rest of the application the way a modal dialog does. It also has a different look, "descending" from the main window's title bar as though pulled down ("unfurl" is Apple's term), rather than popping up like a dialog. A sheet is "document modal" rather than "application modal".

Given the above, I'm not sure it is a bug...

apeoperaio

  • Sr. Member
  • ****
  • Posts: 272
Re: Main form TMainMenu enabled while another form is ShowModal
« Reply #2 on: November 27, 2020, 10:40:23 am »
I know that there are modal "sheets" in mac but apart of it I think that the actual behaviour with modal form is wrong.
1. the behaviour in mac is different from win and linux
2. opening a modal form disable the menus (correct behaviour)
3. menus are enabled only after opening a dialog (wrong behaviour)

It affects lazarus too, see image attached. Step to reproduce:
Open lazarus
New project
Tools --> Options (main menu are disabled)
Open the dialog to change lazarus directory (main menu become enabled)



apeoperaio

  • Sr. Member
  • ****
  • Posts: 272

 

TinyPortal © 2005-2018