Skip to content

Commit f478b2f

Browse files
committed
Updates after feedback
1 parent 1b1c958 commit f478b2f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

engine/src/desktop.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -864,15 +864,15 @@ void MCPlatformHandleTextInputInsertText(MCPlatformWindowRef p_window, unichar_t
864864
uint8_t t_mapped_char[2];
865865
map_key_to_engine(s_pending_key_down -> key_code, s_pending_key_down -> mapped_codepoint, s_pending_key_down -> unmapped_codepoint, t_mapped_key_code, t_mapped_char);
866866

867+
// SN-2014-11-03: [[ Bug 13832 ]] Enqueue the event, instead of firing it now (we are still in the NSApplication's keyDown).
868+
869+
// PM-2015-05-15: [[ Bug 15372]] call MCKeyMessageAppend before wkdown to prevent a crash if 'wait with messages' is used (since s_pending_key_down might become nil after wkdown
870+
MCKeyMessageAppend(s_pending_key_up, s_pending_key_down -> key_code, s_pending_key_down -> mapped_codepoint, s_pending_key_down -> unmapped_codepoint);
871+
867872
MCdispatcher -> wkdown(p_window, (const char *)t_mapped_char, t_mapped_key_code);
868873

869-
// SN-2014-11-03: [[ Bug 13832 ]] Enqueue the event, instead of firing it now (we are still in the NSApplication's keyDown).
870-
// PM-2015-05-15: [[ Bug 15372]] s_pending_key_down might become nil in the meanwhile, if 'wait with messages' is used
871-
if (s_pending_key_down != nil)
872-
{
873-
MCKeyMessageAppend(s_pending_key_up, s_pending_key_down -> key_code, s_pending_key_down -> mapped_codepoint, s_pending_key_down -> unmapped_codepoint);
874-
MCKeyMessageNext(s_pending_key_down);
875-
}
874+
MCKeyMessageNext(s_pending_key_down);
875+
876876
}
877877
return;
878878
}

0 commit comments

Comments
 (0)