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
This commit is contained in:
Fred Kiefer 2009-11-02 12:13:59 +00:00
parent eecdf96f4b
commit 2cd86dee14
2 changed files with 15 additions and 3 deletions

View file

@ -1,3 +1,8 @@
2009-11-02 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSApplication.m (-nextEventMatchingMask:...): Only set
the current event when dequeuing and never return the null_event.
2009-11-02 Fred Kiefer <FredKiefer@gmx.de>
* Source/GSTheme.m: Remove some compiler warnings.

View file

@ -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;
}