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; NSEvent *e;
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
NSPoint p; NSPoint p;
NSWindow *menuWindow = [mr window];
if ([self isEnabled] == NO) if ([self isEnabled] == NO)
return; return;
@ -329,7 +330,7 @@ Class _nspopupbuttonCellClass = 0;
inView: self]; inView: self];
p = [_window convertBaseToScreen: [theEvent locationInWindow]]; p = [_window convertBaseToScreen: [theEvent locationInWindow]];
p = [[mr window] convertScreenToBase: p]; p = [menuWindow convertScreenToBase: p];
// Process events; we start menu events processing by converting // Process events; we start menu events processing by converting
// this event to the menu window, and sending it there. // this event to the menu window, and sending it there.
@ -337,12 +338,12 @@ Class _nspopupbuttonCellClass = 0;
location: p location: p
modifierFlags: [theEvent modifierFlags] modifierFlags: [theEvent modifierFlags]
timestamp: [theEvent timestamp] timestamp: [theEvent timestamp]
windowNumber: [[mr window] windowNumber] windowNumber: [menuWindow windowNumber]
context: nil // TODO ? context: nil // TODO ?
eventNumber: [theEvent eventNumber] eventNumber: [theEvent eventNumber]
clickCount: [theEvent clickCount] clickCount: [theEvent clickCount]
pressure: [theEvent pressure]]; pressure: [theEvent pressure]];
[[mr window] sendEvent: e]; [menuWindow sendEvent: e];
// Update our selected item // Update our selected item
[self synchronizeTitleAndSelectedItem]; [self synchronizeTitleAndSelectedItem];