Spare two method calls when on mouse down

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@10282 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Nicola Pero 2001-07-03 18:14:35 +00:00
parent eea27a7320
commit d09426e14b

View file

@ -317,6 +317,7 @@ Class _nspopupbuttonCellClass = 0;
NSEvent *e;
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
NSPoint p;
NSWindow *menuWindow = [mr window];
if ([self isEnabled] == NO)
return;
@ -326,23 +327,23 @@ Class _nspopupbuttonCellClass = 0;
// Attach the popUp
[_cell attachPopUpWithFrame: _bounds
inView: self];
inView: self];
p = [_window convertBaseToScreen: [theEvent locationInWindow]];
p = [[mr window] convertScreenToBase: p];
p = [menuWindow convertScreenToBase: p];
// Process events; we start menu events processing by converting
// this event to the menu window, and sending it there.
e = [NSEvent mouseEventWithType: [theEvent type]
location: p
modifierFlags: [theEvent modifierFlags]
timestamp: [theEvent timestamp]
windowNumber: [[mr window] windowNumber]
windowNumber: [menuWindow windowNumber]
context: nil // TODO ?
eventNumber: [theEvent eventNumber]
clickCount: [theEvent clickCount]
pressure: [theEvent pressure]];
[[mr window] sendEvent: e];
[menuWindow sendEvent: e];
// Update our selected item
[self synchronizeTitleAndSelectedItem];