Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 3630da7

Browse files
Merge pull request #7501 from livecodeian/bugfix-23053
[[ Bug 23053 ]] Fix frozen color picker launched from modal stack on macOS
2 parents 597570c + eee2d54 commit 3630da7

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

docs/notes/bugfix-23053.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Fix the color dialog failing to respond to input events when launched from a modal stack on macOS

engine/src/mac-core.mm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -788,13 +788,17 @@ bool MCPlatformWaitForEvent(double p_duration, bool p_blocking)
788788
// Track whether a modal session was closed or not
789789
bool t_modal_closed = false;
790790

791+
// Pseudo-modal views require event dispatching, even when launched within a modal session
792+
bool t_pseudo_modal;
793+
t_pseudo_modal = MCMacPlatformApplicationPseudoModalFor() != nil;
794+
791795
NSAutoreleasePool *t_pool;
792796
t_pool = [[NSAutoreleasePool alloc] init];
793797

794798
// MW-2014-07-24: [[ Bug 12939 ]] If we are running a modal session, then don't then wait
795799
// for events - event handling happens inside the modal session.
796800
NSEvent *t_event = nil;
797-
if (s_modal_sessions.Size() > 0)
801+
if (s_modal_sessions.Size() > 0 && !t_pseudo_modal)
798802
{
799803
// Wait for an event, but leave on the queue
800804
t_event = [NSApp nextEventMatchingMask: p_blocking ? NSApplicationDefinedMask : NSAnyEventMask

0 commit comments

Comments
 (0)