fix problem of pulldown action not being called for correct cell, and being called twice on Windows

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31213 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
dpsimons 2010-08-30 23:02:21 +00:00
parent 26c6942f2d
commit ae51e23b36
3 changed files with 21 additions and 0 deletions

View file

@ -1452,6 +1452,13 @@ static NSMapTable *viewInfo = 0;
NSEvent *original;
NSEventType type;
NSEventType end;
NSPopUpButtonCell *bcell = nil;
SEL bcellAction = NULL;
if([_attachedMenu _ownedByPopUp])
{
bcell = [_attachedMenu _owningPopUp];
bcellAction = [bcell action];
}
/*
* The original event is unused except to determine whether the method
@ -1656,11 +1663,13 @@ static NSMapTable *viewInfo = 0;
lastLocation = location;
}
[bcell setAction:NULL]; // block actions while fetching an event (this is a problem on Windows)
event = [NSApp nextEventMatchingMask: eventMask
untilDate: theDistantFuture
inMode: NSEventTrackingRunLoopMode
dequeue: YES];
type = [event type];
[bcell setAction:bcellAction]; // restore the popUpButtonCell's action
}
while (type != end || shouldFinish == NO);