[epiphany] actions: fix return value for button press events that pop up menus



commit b6602f5c5b2bef6862c103e781a3be6a76749ba3
Author: Claudio Saavedra <csaavedra igalia com>
Date:   Mon Sep 9 10:23:48 2013 +0300

    actions: fix return value for button press events that pop up menus
    
    Otherwise the GTK+ will pop up the menu from the WM actions.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=707721

 src/ephy-navigation-history-action.c |    7 ++++---
 src/ephy-page-menu-action.c          |    6 ++++--
 2 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/src/ephy-navigation-history-action.c b/src/ephy-navigation-history-action.c
index dec2290..4f7f1c9 100644
--- a/src/ephy-navigation-history-action.c
+++ b/src/ephy-navigation-history-action.c
@@ -651,10 +651,11 @@ tool_button_press_event_cb (GtkButton *button,
                                                      (GSourceFunc) menu_timeout_cb,
                                                      data,
                                                      (GDestroyNotify) g_free);
-  } else if (event->button == 3)
+    return FALSE;
+  } else if (event->button == 3) {
     popup_history_menu (action, GTK_WIDGET (button), event);
-
-  return FALSE;
+    return TRUE;
+  }
 }
 
 static gboolean
diff --git a/src/ephy-page-menu-action.c b/src/ephy-page-menu-action.c
index e50ceab..2b68708 100644
--- a/src/ephy-page-menu-action.c
+++ b/src/ephy-page-menu-action.c
@@ -76,7 +76,7 @@ visible_cb (GtkWidget *menu, GParamSpec *pspec, GtkWidget *button)
                                     "active-menu");
 }
 
-static void
+static gboolean
 button_press_cb (GtkWidget *button, GdkEventButton *event, EphyPageMenuAction *action)
 {
   GtkWidget *menu;
@@ -91,7 +91,7 @@ button_press_cb (GtkWidget *button, GdkEventButton *event, EphyPageMenuAction *a
       button = GTK_WIDGET (l->data);
   }
 
-  g_return_if_fail (GTK_IS_BUTTON (button));
+  g_return_val_if_fail (GTK_IS_BUTTON (button), FALSE);
 
   if (!action->priv->menu) {
     window = ephy_window_action_get_window (EPHY_WINDOW_ACTION (action));
@@ -114,6 +114,8 @@ button_press_cb (GtkWidget *button, GdkEventButton *event, EphyPageMenuAction *a
                   NULL, NULL,
                   (GtkMenuPositionFunc)menu_position_func, button,
                   event_button, event_time);
+
+  return TRUE;
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]