From 1fd80dabc25a197c88014c62582c58a6d490e53d Mon Sep 17 00:00:00 2001 From: williameveretteggplant <44709277+williameveretteggplant@users.noreply.github.com> Date: Wed, 7 Aug 2024 16:48:39 -0600 Subject: [PATCH 1/3] Force modal to front --- Source/NSApplication.m | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/NSApplication.m b/Source/NSApplication.m index 1de44a1bd..0b81e30cc 100644 --- a/Source/NSApplication.m +++ b/Source/NSApplication.m @@ -1785,6 +1785,7 @@ - (NSInteger) runModalForWindow: (NSWindow*)theWindow /* * Try to handle events for this session, discarding others. */ + [theSession->window orderFrontRegardless]; code = [self runModalSession: theSession]; if (code == NSRunContinuesResponse) { From 8760810340d34b9871752ac4e3940cca54fb73ed Mon Sep 17 00:00:00 2001 From: William Everett Date: Thu, 8 Aug 2024 10:02:52 -0600 Subject: [PATCH 2/3] Revert "Force modal to front" This reverts commit 1fd80dabc25a197c88014c62582c58a6d490e53d. --- Source/NSApplication.m | 1 - 1 file changed, 1 deletion(-) diff --git a/Source/NSApplication.m b/Source/NSApplication.m index 0b81e30cc..1de44a1bd 100644 --- a/Source/NSApplication.m +++ b/Source/NSApplication.m @@ -1785,7 +1785,6 @@ - (NSInteger) runModalForWindow: (NSWindow*)theWindow /* * Try to handle events for this session, discarding others. */ - [theSession->window orderFrontRegardless]; code = [self runModalSession: theSession]; if (code == NSRunContinuesResponse) { From dd6705778479c45217b7156aa2d3d5ae763039b4 Mon Sep 17 00:00:00 2001 From: williameveretteggplant <44709277+williameveretteggplant@users.noreply.github.com> Date: Thu, 8 Aug 2024 10:16:27 -0600 Subject: [PATCH 3/3] push modal window to top later in process --- Source/NSApplication.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/NSApplication.m b/Source/NSApplication.m index 1de44a1bd..6eb00e212 100644 --- a/Source/NSApplication.m +++ b/Source/NSApplication.m @@ -1677,7 +1677,7 @@ - (NSModalSession) beginModalSessionForWindow: (NSWindow*)theWindow [theWindow center]; [theWindow setLevel: NSModalPanelWindowLevel]; } - [theWindow orderFrontRegardless]; + if ([self isActive] == YES) { if ([theWindow canBecomeKeyWindow] == YES) @@ -1689,6 +1689,7 @@ - (NSModalSession) beginModalSessionForWindow: (NSWindow*)theWindow [theWindow makeMainWindow]; } } + [theWindow orderFrontRegardless]; return theSession; }