Recent

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

apeoperaio

  • Full Member
  • ***
  • Posts: 198
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: 1206
  • 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...
o Lazarus 2.1.0 r64368, FPC 3.3.1 r48100, macOS 10.14.6, Xcode 11.3.1
o Lazarus 2.1.0 r64392, FPC 3.3.1 Jan 13 21:24, macOS 11.1 (aarch64), Xcode 12.3
o Lazarus 2.1.0 r61574, FPC 3.3.1 r42318, FreeBSD 12.1 amd64 (VMware VM)
o Lazarus 2.1.0 r61574, FPC 3.0.4, Ubuntu 20.04 (Parallels VM)

apeoperaio

  • Full Member
  • ***
  • Posts: 198
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

  • Full Member
  • ***
  • Posts: 198

 

TinyPortal © 2005-2018