mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-25 05:10:57 +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;
|
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;
|
||||||
|
@ -326,10 +327,10 @@ Class _nspopupbuttonCellClass = 0;
|
||||||
|
|
||||||
// Attach the popUp
|
// Attach the popUp
|
||||||
[_cell attachPopUpWithFrame: _bounds
|
[_cell attachPopUpWithFrame: _bounds
|
||||||
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];
|
||||||
|
|
Loading…
Reference in a new issue