Fix hang when clicking on the user status menu in the overview

shell-global.[ch]: Add shell_global_display_is_grabbed() that
  uses the newly added meta_display_get_grab_op() to check
  for existing grabs.
shell-status-menu.[ch]: Add shell_status_menu_is_active() to
  check if the menu is popped up. Check for active grabs before
  popping the menu up. Use gtk_menu_popdown() rather than
  gtk_widget_hide(). Remove an excess gtk_widget_show() and
  some excess casts.
panel.js: Check whether the status menu is popped up after button
  release, and if it's not popped up, unhighlight the button.

Reported by Nuno Donato
http://bugzilla.gnome.org/show_bug.cgi?id=593362
This commit is contained in:
Owen W. Taylor
2009-08-28 11:27:39 -04:00
parent 3adec65e20
commit 1340413740
5 changed files with 69 additions and 5 deletions

View File

@ -381,6 +381,14 @@ Panel.prototype = {
statusmenu.toggle(e);
return false;
});
// This depends on connection ordering: since we are after the Button's
// ::button-release-event handler, calling button.release() will properly
// unset the 'active' flag for this stays-pressed button
statusbutton.button.connect('button-release-event', function (b, e) {
if (!statusmenu.is_active())
statusbutton.release();
return false;
});
this._rightBox.append(statusbutton.button, Big.BoxPackFlags.NONE);
// We get a deactivated event when the popup disappears
this._statusmenu.connect('deactivated', function (sm) {