From 4b889eac32eb2b53fcd17f822f0424697b349848 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Wed, 12 Jun 2013 03:35:28 -0400 Subject: [PATCH] popupMenu: Ensure that submenus are properly hidden when insensitive We don't actually propagate sensitivity information to submenus; we simply make sure that they can never be open when the parent is insensitive. https://bugzilla.gnome.org/show_bug.cgi?id=702539 --- js/ui/popupMenu.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js index e14f75d4f..5918c93f6 100644 --- a/js/ui/popupMenu.js +++ b/js/ui/popupMenu.js @@ -1340,6 +1340,13 @@ const PopupSubMenuMenuItem = new Lang.Class({ this.menu.connect('open-state-changed', Lang.bind(this, this._subMenuOpenStateChanged)); }, + syncSensitive: function() { + let sensitive = this.parent(); + this._triangle.visible = sensitive; + if (!sensitive) + this.menu.close(false); + }, + _subMenuOpenStateChanged: function(menu, open) { if (open) this.actor.add_style_pseudo_class('open');