[gnome-shell/gnome-3-8] PopupMenuManager: Close active menu when another one opens
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gnome-3-8] PopupMenuManager: Close active menu when another one opens
- Date: Fri, 26 Apr 2013 16:17:08 +0000 (UTC)
commit 0d8d77356ee58bca96f626ebf4fc1d8cf48f2aaa
Author: Florian Müllner <fmuellner gnome org>
Date: Fri Apr 26 17:06:22 2013 +0200
PopupMenuManager: Close active menu when another one opens
We already do this when navigating between menus via mouse or
keynav, but miss cases where a menu is opened by other means,
for instance via a keyboard shortcut.
https://bugzilla.gnome.org/show_bug.cgi?id=686756
js/ui/popupMenu.js | 11 ++++-------
1 files changed, 4 insertions(+), 7 deletions(-)
---
diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js
index 8d55954..fc37dd8 100644
--- a/js/ui/popupMenu.js
+++ b/js/ui/popupMenu.js
@@ -2124,6 +2124,8 @@ const PopupMenuManager = new Lang.Class({
_onMenuOpenState: function(menu, open) {
if (open) {
+ if (this.activeMenu)
+ this.activeMenu.close(BoxPointer.PopupAnimation.FADE);
this._grabHelper.grab({ actor: menu.actor, modal: true, focus: menu.sourceActor,
onUngrab: Lang.bind(this, this._closeMenu, menu) });
} else {
@@ -2140,13 +2142,8 @@ const PopupMenuManager = new Lang.Class({
},
_changeMenu: function(newMenu) {
- let oldMenu = this.activeMenu;
- if (oldMenu) {
- oldMenu.close(BoxPointer.PopupAnimation.FADE);
- newMenu.open(BoxPointer.PopupAnimation.FADE);
- } else {
- newMenu.open(BoxPointer.PopupAnimation.FULL);
- }
+ newMenu.open(this.activeMenu ? BoxPointer.PopupAnimation.FADE
+ : BoxPointer.PopupAnimation.FULL);
},
_onMenuSourceEnter: function(menu) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]