This is an automated email from the git hooks/post-receive script.

gottcode pushed a commit to branch master
in repository panel-plugins/xfce4-whiskermenu-plugin.

commit 65f616022646c6fdbad80ce78d6beb4e44d90b72
Author: Graeme Gott <gra...@gottcode.org>
Date:   Tue Oct 25 08:20:20 2016 -0400

    Replace gtk_menu_popup().
---
 panel-plugin/page.cpp | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/panel-plugin/page.cpp b/panel-plugin/page.cpp
index 063f934..276db3e 100644
--- a/panel-plugin/page.cpp
+++ b/panel-plugin/page.cpp
@@ -197,7 +197,6 @@ gboolean Page::view_popup_menu_event(GtkWidget* view)
 
 void Page::create_context_menu(GtkTreeIter* iter, GdkEvent* event)
 {
-       GdkEventButton* event_button = reinterpret_cast<GdkEventButton*>(event);
        m_selected_path = gtk_tree_model_get_path(m_view->get_model(), iter);
        Launcher* launcher = get_selected_launcher();
        if (!launcher)
@@ -268,11 +267,17 @@ G_GNUC_END_IGNORE_DEPRECATIONS
        gtk_widget_show_all(menu);
 
        // Show context menu
+       gtk_tree_view_set_hover_selection(GTK_TREE_VIEW(m_view->get_widget()), 
false);
+       gtk_menu_attach_to_widget(GTK_MENU(menu), m_view->get_widget(), NULL);
+#if GTK_CHECK_VERSION(3,22,0)
+       gtk_menu_popup_at_pointer(GTK_MENU(menu), event);
+#else
        int button = 0;
        int event_time;
        GtkMenuPositionFunc position_func = NULL;
        if (event)
        {
+               GdkEventButton* event_button = 
reinterpret_cast<GdkEventButton*>(event);
                button = event_button->button;
                event_time = event_button->time;
        }
@@ -282,9 +287,8 @@ G_GNUC_END_IGNORE_DEPRECATIONS
                event_time = gtk_get_current_event_time ();
        }
 
-       gtk_tree_view_set_hover_selection(GTK_TREE_VIEW(m_view->get_widget()), 
false);
-       gtk_menu_attach_to_widget(GTK_MENU(menu), m_view->get_widget(), NULL);
        gtk_menu_popup(GTK_MENU(menu), NULL, NULL, position_func, this, button, 
event_time);
+#endif
 }
 
 //-----------------------------------------------------------------------------

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.
_______________________________________________
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits

Reply via email to