diff --git a/ChangeLog b/ChangeLog index 14b1a66..429e224 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2013-01-11 Fred Kiefer + + * Source/win32/w32_general.m (-decodeWM_CLOSEParams:::): Post the + close event instead of sending it directly to the window. + Patch by Doug Simons + 2013-01-05 00:54-EST Gregory John Casamento Merging changes made by Marcian Lytwyn diff --git a/Source/win32/w32_general.m b/Source/win32/w32_general.m index f21c1d2..98b88b4 100644 --- a/Source/win32/w32_general.m +++ b/Source/win32/w32_general.m @@ -35,10 +35,11 @@ @implementation WIN32Server (w32_General) -- (void) decodeWM_CLOSEParams:(WPARAM)wParam :(LPARAM)lParam :(HWND)hwnd; +- (void) decodeWM_CLOSEParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd { - NSEvent * ev; + NSEvent *ev; NSPoint eventLocation = NSMakePoint(0, 0); + ev = [NSEvent otherEventWithType: NSAppKitDefined location: eventLocation modifierFlags: 0 @@ -49,11 +50,11 @@ data1: 0 data2: 0]; - // need to send the event... or handle it directly. - [EVENT_WINDOW(hwnd) sendEvent:ev]; + // Sending the event directly to the window bypasses the event queue, + // which can cause a modal loop to lock up. + [GSCurrentServer() postEvent: ev atStart: NO]; - ev=nil; - flags._eventHandled=YES; + flags._eventHandled = YES; } - (void) decodeWM_NCDESTROYParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd @@ -77,7 +78,6 @@ free(win); free((IME_INFO_T*)GetWindowLongPtr(hwnd, IME_INFO)); flags._eventHandled=YES; - } - (void) decodeWM_QUERYOPENParams: (WPARAM)wParam : (LPARAM)lParam : (HWND)hwnd