[Xfce4-commits] <midori:master> Right-click on statusbar border should show context menu

Christian Dywan noreply at xfce.org
Tue Oct 26 00:32:02 CEST 2010


Updating branch refs/heads/master
         to 691f6c7bbd1312c44af33b1ad2f05cfe73fbaa8d (commit)
       from 7a993b9f19bec46ff207d1c1198ea9d9fca02ba2 (commit)

commit 691f6c7bbd1312c44af33b1ad2f05cfe73fbaa8d
Author: Christian Dywan <christian at twotoasts.de>
Date:   Mon Oct 25 23:40:34 2010 +0200

    Right-click on statusbar border should show context menu

 midori/midori-browser.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/midori/midori-browser.c b/midori/midori-browser.c
index 4253858..b086045 100644
--- a/midori/midori-browser.c
+++ b/midori/midori-browser.c
@@ -3908,12 +3908,13 @@ midori_browser_menu_button_press_event_cb (GtkWidget*      toolitem,
                                            GdkEventButton* event,
                                            MidoriBrowser*  browser)
 {
+    if (event->button != 3)
+        return FALSE;
+
     /* GtkMenuBar catches button events on children with submenus,
        so we need to see if the actual widget is the menubar, and if
        it is an item, we forward it to the actual widget. */
-    toolitem = gtk_get_event_widget ((GdkEvent*)event);
-
-    if (GTK_IS_MENU_BAR (toolitem) && event->button == 3)
+    if ((GTK_IS_BOX (toolitem) || GTK_IS_MENU_BAR (toolitem)))
     {
         midori_browser_toolbar_popup_context_menu_cb (
             GTK_IS_BIN (toolitem) && gtk_bin_get_child (GTK_BIN (toolitem)) ?
@@ -3921,7 +3922,7 @@ midori_browser_menu_button_press_event_cb (GtkWidget*      toolitem,
             event->x, event->y, event->button, browser);
         return TRUE;
     }
-    else if (GTK_IS_MENU_ITEM (toolitem) && event->button == 3)
+    else if (GTK_IS_MENU_ITEM (toolitem))
     {
         gboolean handled;
         g_signal_emit_by_name (toolitem, "button-press-event", event, &handled);



More information about the Xfce4-commits mailing list