From c353a6b67b9adbbd3fac94cb36b164983676710b Mon Sep 17 00:00:00 2001 From: fredkiefer Date: Mon, 2 Nov 2009 12:13:59 +0000 Subject: [PATCH] Only set the current event when dequeuing and never return the null_event. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28938 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++++ Source/NSApplication.m | 13 ++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8cbe819fb..fd4f755eb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-11-02 Fred Kiefer + + * Source/NSApplication.m (-nextEventMatchingMask:...): Only set + the current event when dequeuing and never return the null_event. + 2009-11-02 Fred Kiefer * Source/GSTheme.m: Remove some compiler warnings. diff --git a/Source/NSApplication.m b/Source/NSApplication.m index e2ebe3c75..ed147267c 100644 --- a/Source/NSApplication.m +++ b/Source/NSApplication.m @@ -1514,7 +1514,7 @@ static NSSize scaledIconSizeForSize(NSSize imageSize) inMode: NSDefaultRunLoopMode dequeue: YES]; - if (e != nil && e != null_event) + if (e != nil) { NSEventType type = [e type]; @@ -2105,6 +2105,12 @@ See -runModalForWindow: else event = DPSPeekEvent(GSCurrentServer(), mask, expiration, mode); + if (event == null_event) + { + // Never return the null_event + event = nil; + } + if (event) { IF_NO_GC(NSAssert([event retainCount] > 0, NSInternalInconsistencyException)); @@ -2112,7 +2118,7 @@ IF_NO_GC(NSAssert([event retainCount] > 0, NSInternalInconsistencyException)); * If we are not in a tracking loop, we may want to unhide a hidden * because the mouse has been moved. */ - if (mode != NSEventTrackingRunLoopMode && event != null_event) + if (mode != NSEventTrackingRunLoopMode) { _windows_need_update = YES; if ([NSCursor isHiddenUntilMouseMoves]) @@ -2129,7 +2135,8 @@ IF_NO_GC(NSAssert([event retainCount] > 0, NSInternalInconsistencyException)); } } - ASSIGN(_current_event, event); + if (flag) + ASSIGN(_current_event, event); } return event; }