mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-24 20:49:13 +00:00
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:
parent
eea27a7320
commit
d09426e14b
1 changed files with 7 additions and 6 deletions
|
@ -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];
|
||||
|
|
Loading…
Reference in a new issue