popupMenu: fix up grab/ungrab handling
Fix the panel menus to avoid unnecessarily bouncing out of modal (bug 634194) and to do a better job of keeping the keyboard focus in the right place https://bugzilla.gnome.org/show_bug.cgi?id=618885
This commit is contained in:
@ -47,12 +47,9 @@ Button.prototype = {
|
||||
},
|
||||
|
||||
_onOpenStateChanged: function(menu, open) {
|
||||
if (open) {
|
||||
if (open)
|
||||
this.actor.add_style_pseudo_class('pressed');
|
||||
let focus = global.stage.get_key_focus();
|
||||
if (!focus || (focus != this.actor && !menu.actor.contains(focus)))
|
||||
this.actor.grab_key_focus();
|
||||
} else
|
||||
else
|
||||
this.actor.remove_style_pseudo_class('pressed');
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user