From ad749a173afe8f857d649e1ada0b51a1e8d283e1 Mon Sep 17 00:00:00 2001 From: fredkiefer Date: Fri, 11 Jan 2013 09:29:17 +0000 Subject: [PATCH] * Source/win32/w32_general.m (-decodeWM_CLOSEParams:::): Post the close event instead of sending it directly to the window. Patch by Doug Simons git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@35949 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 6 ++++++ Source/win32/w32_general.m | 14 +++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) 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