summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2009-09-25 20:45:21 (GMT)
committerColin Walters <walters@verbum.org>2009-10-02 23:28:25 (GMT)
commit3b8d53060d1b7146bde0854906a1a1285641a047 (patch)
tree1e8a2225bf40fb820d3f59cb16a5d30d39a02c01
parentc5ce40585931af121ae8e759e80e0094c0594ef9 (diff)
downloadgnome-shell-3b8d53060d1b7146bde0854906a1a1285641a047.tar.gz
gnome-shell-3b8d53060d1b7146bde0854906a1a1285641a047.tar.xz
Immediately pop up menu on right click
We were actually showing a menu on button 3 before, but only through a chain of coincidences. This patch explicitly supports it and makes sure we show it immediately rather than after a timeout. Pass the activating button in so that we only pop down on that button. https://bugzilla.gnome.org/show_bug.cgi?id=596371
-rw-r--r--js/ui/appIcon.js21
1 files changed, 13 insertions, 8 deletions
diff --git a/js/ui/appIcon.js b/js/ui/appIcon.js
index e6d8ec8..7a9df6f 100644
--- a/js/ui/appIcon.js
+++ b/js/ui/appIcon.js
@@ -210,14 +210,19 @@ AppIcon.prototype = {
},
_updateMenuOnButtonPress: function(actor, event) {
- if (this._menuTimeoutId != 0)
- Mainloop.source_remove(this._menuTimeoutId);
- this._menuTimeoutId = Mainloop.timeout_add(APPICON_MENU_POPUP_TIMEOUT_MS,
- Lang.bind(this, this.popupMenu));
+ let button = event.get_button();
+ if (button == 1) {
+ if (this._menuTimeoutId != 0)
+ Mainloop.source_remove(this._menuTimeoutId);
+ this._menuTimeoutId = Mainloop.timeout_add(APPICON_MENU_POPUP_TIMEOUT_MS,
+ Lang.bind(this, function () { this.popupMenu(button); }));
+ } else if (button == 3) {
+ this.popupMenu(button);
+ }
return false;
},
- popupMenu: function() {
+ popupMenu: function(activatingButton) {
if (this._menuTimeoutId != 0) {
Mainloop.source_remove(this._menuTimeoutId);
this._menuTimeoutId = 0;
@@ -241,7 +246,7 @@ AppIcon.prototype = {
}));
}
- this._menu.popup();
+ this._menu.popup(activatingButton);
return false;
},
@@ -476,13 +481,13 @@ AppIconMenu.prototype = {
}
},
- popup: function() {
+ popup: function(activatingButton) {
let [stageX, stageY] = this._source.actor.get_transformed_position();
let [stageWidth, stageHeight] = this._source.actor.get_transformed_size();
this._redisplay();
- this._windowContainer.popup(0, Main.currentTime());
+ this._windowContainer.popup(activatingButton, Main.currentTime());
this.emit('popup', true);