summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2009-09-25 20:44:28 (GMT)
committerColin Walters <walters@verbum.org>2009-10-02 23:28:25 (GMT)
commitc5ce40585931af121ae8e759e80e0094c0594ef9 (patch)
tree8b25032e8a998de98893b938502f4abf2fe7d94e
parentb3a5fc72fba8c474ba70c1acb1f14903f1661ca8 (diff)
downloadgnome-shell-c5ce40585931af121ae8e759e80e0094c0594ef9.tar.gz
gnome-shell-c5ce40585931af121ae8e759e80e0094c0594ef9.tar.xz
Ignore releases of buttons other than the activating button
Before we hardcoded popdowns to only button 1 before. But we need to actually pop down on the release of the activating button. (Once the button is released, if the we don't pop-down the menu, then subsequently we let the user use any button.) https://bugzilla.gnome.org/show_bug.cgi?id=596371
-rw-r--r--src/shell-menu.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/shell-menu.c b/src/shell-menu.c
index 0eace37..4fce08c 100644
--- a/src/shell-menu.c
+++ b/src/shell-menu.c
@@ -15,6 +15,7 @@ G_DEFINE_TYPE(ShellMenu, shell_menu, BIG_TYPE_BOX);
struct _ShellMenuPrivate {
gboolean popped_up;
gboolean have_grab;
+ guint activating_button;
gboolean released_on_source;
ClutterActor *source_actor;
@@ -117,9 +118,15 @@ shell_menu_button_release_event (ClutterActor *actor,
{
ShellMenu *box = SHELL_MENU (actor);
- if (event->button != 1)
+ /* Until the user releases the button that brought up the menu, we just
+ * ignore other button press/releass.
+ * See https://bugzilla.gnome.org/show_bug.cgi?id=596371
+ */
+ if (box->priv->activating_button > 0 && box->priv->activating_button != event->button)
return FALSE;
+ box->priv->activating_button = 0;
+
if (box->priv->source_actor && !box->priv->released_on_source)
{
if (box->priv->source_actor == event->source ||
@@ -134,13 +141,8 @@ shell_menu_button_release_event (ClutterActor *actor,
shell_menu_popdown_nosignal (box);
- if (!container_contains (CLUTTER_CONTAINER (box), event->source))
- {
- g_signal_emit (G_OBJECT (box), shell_menu_signals[CANCELLED], 0);
- return FALSE;
- }
-
- if (box->priv->selected == NULL)
+ if (!container_contains (CLUTTER_CONTAINER (box), event->source) ||
+ box->priv->selected == NULL)
{
g_signal_emit (G_OBJECT (box), shell_menu_signals[CANCELLED], 0);
return FALSE;
@@ -158,6 +160,7 @@ shell_menu_popup (ShellMenu *box,
{
if (box->priv->popped_up)
return;
+ box->priv->activating_button = button;
box->priv->popped_up = TRUE;
box->priv->have_grab = TRUE;
box->priv->released_on_source = FALSE;