[Xfce4-commits] [xfce/xfce4-panel] 01/01: Try to fix menu positioning with Gtk3.22

noreply at xfce.org noreply at xfce.org
Wed Jan 3 00:56:43 CET 2018


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

o   c   h   o   s   i       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository xfce/xfce4-panel.

commit bffe11c318b8290a6be24330f0a516757ea1ca70
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date:   Wed Jan 3 00:56:37 2018 +0100

    Try to fix menu positioning with Gtk3.22
    
    Follow-up of patch 43dfa79865eed5948c62847b1d03a8010e13d9a2 and Bug #14135
---
 plugins/actions/actions.c                   |  6 ++++--
 plugins/applicationsmenu/applicationsmenu.c |  6 ++++--
 plugins/directorymenu/directorymenu.c       |  6 ++++--
 plugins/launcher/launcher.c                 |  7 +++++--
 plugins/tasklist/tasklist-widget.c          | 28 ++++++++++++++++------------
 plugins/windowmenu/windowmenu.c             |  6 ++++--
 6 files changed, 37 insertions(+), 22 deletions(-)

diff --git a/plugins/actions/actions.c b/plugins/actions/actions.c
index 6daa3a6..271448f 100644
--- a/plugins/actions/actions.c
+++ b/plugins/actions/actions.c
@@ -1331,8 +1331,10 @@ actions_plugin_menu (GtkWidget     *button,
 
 #if GTK_CHECK_VERSION (3, 22, 0)
   gtk_menu_popup_at_widget (GTK_MENU (plugin->menu), button,
-                            GDK_GRAVITY_SOUTH_WEST,
-                            GDK_GRAVITY_NORTH_WEST,
+                            xfce_panel_plugin_get_orientation (XFCE_PANEL_PLUGIN (plugin)) == GTK_ORIENTATION_VERTICAL
+                            ? GDK_GRAVITY_WEST : GDK_GRAVITY_NORTH,
+                            xfce_panel_plugin_get_orientation (XFCE_PANEL_PLUGIN (plugin)) == GTK_ORIENTATION_VERTICAL
+                            ? GDK_GRAVITY_EAST : GDK_GRAVITY_SOUTH,
                             NULL);
 #else
   gtk_menu_popup (GTK_MENU (plugin->menu), NULL, NULL,
diff --git a/plugins/applicationsmenu/applicationsmenu.c b/plugins/applicationsmenu/applicationsmenu.c
index fdf7614..347bb5e 100644
--- a/plugins/applicationsmenu/applicationsmenu.c
+++ b/plugins/applicationsmenu/applicationsmenu.c
@@ -787,8 +787,10 @@ applications_menu_plugin_menu (GtkWidget              *button,
   /* show the menu */
 #if GTK_CHECK_VERSION (3, 22, 0)
   gtk_menu_popup_at_widget (GTK_MENU (plugin->menu), button,
-                            GDK_GRAVITY_SOUTH_WEST,
-                            GDK_GRAVITY_NORTH_WEST,
+                            xfce_panel_plugin_get_orientation (XFCE_PANEL_PLUGIN (plugin)) == GTK_ORIENTATION_VERTICAL
+                            ? GDK_GRAVITY_WEST : GDK_GRAVITY_NORTH,
+                            xfce_panel_plugin_get_orientation (XFCE_PANEL_PLUGIN (plugin)) == GTK_ORIENTATION_VERTICAL
+                            ? GDK_GRAVITY_EAST : GDK_GRAVITY_SOUTH,
                             (GdkEvent *) event);
 #else
   gtk_menu_popup (GTK_MENU (plugin->menu), NULL, NULL,
diff --git a/plugins/directorymenu/directorymenu.c b/plugins/directorymenu/directorymenu.c
index 1e9696c..dc6c970 100644
--- a/plugins/directorymenu/directorymenu.c
+++ b/plugins/directorymenu/directorymenu.c
@@ -1019,8 +1019,10 @@ directory_menu_plugin_menu (GtkWidget           *button,
 
 #if GTK_CHECK_VERSION (3, 22, 0)
   gtk_menu_popup_at_widget (GTK_MENU (menu), button,
-                            GDK_GRAVITY_SOUTH_WEST,
-                            GDK_GRAVITY_NORTH_WEST,
+                            xfce_panel_plugin_get_orientation (XFCE_PANEL_PLUGIN (plugin)) == GTK_ORIENTATION_VERTICAL
+                            ? GDK_GRAVITY_WEST : GDK_GRAVITY_NORTH,
+                            xfce_panel_plugin_get_orientation (XFCE_PANEL_PLUGIN (plugin)) == GTK_ORIENTATION_VERTICAL
+                            ? GDK_GRAVITY_EAST : GDK_GRAVITY_SOUTH,
                             NULL);
 #else
   gtk_menu_popup (GTK_MENU (menu), NULL, NULL,
diff --git a/plugins/launcher/launcher.c b/plugins/launcher/launcher.c
index 4111702..ec27955 100644
--- a/plugins/launcher/launcher.c
+++ b/plugins/launcher/launcher.c
@@ -1655,8 +1655,11 @@ launcher_plugin_menu_popup (gpointer user_data)
   /* popup the menu */
 #if GTK_CHECK_VERSION (3, 22, 0)
   gtk_menu_popup_at_widget (GTK_MENU (plugin->menu),
-                            plugin->button, GDK_GRAVITY_SOUTH_WEST,
-                            GDK_GRAVITY_NORTH_WEST,
+                            plugin->button,
+                            xfce_panel_plugin_get_orientation (XFCE_PANEL_PLUGIN (plugin)) == GTK_ORIENTATION_VERTICAL
+                            ? GDK_GRAVITY_WEST : GDK_GRAVITY_NORTH,
+                            xfce_panel_plugin_get_orientation (XFCE_PANEL_PLUGIN (plugin)) == GTK_ORIENTATION_VERTICAL
+                            ? GDK_GRAVITY_EAST : GDK_GRAVITY_SOUTH,
                             NULL);
 #else
   gtk_menu_popup (GTK_MENU (plugin->menu), NULL, NULL,
diff --git a/plugins/tasklist/tasklist-widget.c b/plugins/tasklist/tasklist-widget.c
index 4eedb54..386a184 100644
--- a/plugins/tasklist/tasklist-widget.c
+++ b/plugins/tasklist/tasklist-widget.c
@@ -1513,10 +1513,12 @@ xfce_tasklist_arrow_button_toggled (GtkWidget    *button,
 
       gtk_menu_attach_to_widget (GTK_MENU (menu), button, NULL);
 #if GTK_CHECK_VERSION (3, 22, 0)
-      gtk_menu_popup_at_widget (GTK_MENU (menu),
-                                xfce_tasklist_get_panel_plugin (tasklist),
-                                GDK_GRAVITY_SOUTH_WEST,
-                                GDK_GRAVITY_NORTH_WEST, NULL);
+      gtk_menu_popup_at_widget (GTK_MENU (menu), button,
+                                xfce_tasklist_vertical (tasklist)
+                                ? GDK_GRAVITY_WEST : GDK_GRAVITY_NORTH_EAST,
+                                xfce_tasklist_vertical (tasklist)
+                                ? GDK_GRAVITY_EAST : GDK_GRAVITY_SOUTH_EAST,
+                                NULL);
 #else
       gtk_menu_popup (GTK_MENU (menu), NULL, NULL,
                       xfce_panel_plugin_position_menu,
@@ -2872,10 +2874,11 @@ xfce_tasklist_button_button_press_event (GtkWidget         *button,
 
       gtk_menu_attach_to_widget (GTK_MENU (menu), button, NULL);
 #if GTK_CHECK_VERSION (3, 22, 0)
-      gtk_menu_popup_at_widget (GTK_MENU (menu),
-                                xfce_tasklist_get_panel_plugin (child->tasklist),
-                                GDK_GRAVITY_SOUTH_WEST,
-                                GDK_GRAVITY_NORTH_WEST,
+      gtk_menu_popup_at_widget (GTK_MENU (menu), button,
+                                xfce_tasklist_vertical (child->tasklist)
+                                ? GDK_GRAVITY_SOUTH_EAST : GDK_GRAVITY_NORTH_WEST,
+                                xfce_tasklist_vertical (child->tasklist)
+                                ? GDK_GRAVITY_SOUTH_EAST : GDK_GRAVITY_SOUTH_WEST,
                                 (GdkEvent *) event);
 #else
       gtk_menu_popup (GTK_MENU (menu), NULL, NULL,
@@ -3590,10 +3593,11 @@ xfce_tasklist_group_button_button_press_event (GtkWidget         *button,
 
       gtk_menu_attach_to_widget (GTK_MENU (menu), button, NULL);
 #if GTK_CHECK_VERSION (3, 22, 0)
-      gtk_menu_popup_at_widget (GTK_MENU (menu),
-                                xfce_tasklist_get_panel_plugin (group_child->tasklist),
-                                GDK_GRAVITY_SOUTH_WEST,
-                                GDK_GRAVITY_NORTH_WEST,
+      gtk_menu_popup_at_widget (GTK_MENU (menu), button,
+                                xfce_tasklist_vertical (group_child->tasklist)
+                                ? GDK_GRAVITY_SOUTH_EAST : GDK_GRAVITY_NORTH_WEST,
+                                xfce_tasklist_vertical (group_child->tasklist)
+                                ? GDK_GRAVITY_SOUTH_EAST : GDK_GRAVITY_SOUTH_WEST,
                                 (GdkEvent *) event);
 #else
       gtk_menu_popup (GTK_MENU (menu), NULL, NULL,
diff --git a/plugins/windowmenu/windowmenu.c b/plugins/windowmenu/windowmenu.c
index 67e1582..fbaecc6 100644
--- a/plugins/windowmenu/windowmenu.c
+++ b/plugins/windowmenu/windowmenu.c
@@ -1401,8 +1401,10 @@ window_menu_plugin_menu (GtkWidget        *button,
 
 #if GTK_CHECK_VERSION (3, 22, 0)
   gtk_menu_popup_at_widget (GTK_MENU (menu), button,
-                            GDK_GRAVITY_SOUTH,
-                            GDK_GRAVITY_NORTH_WEST,
+                            xfce_panel_plugin_get_orientation (XFCE_PANEL_PLUGIN (plugin)) == GTK_ORIENTATION_VERTICAL
+                            ? GDK_GRAVITY_WEST : GDK_GRAVITY_NORTH,
+                            xfce_panel_plugin_get_orientation (XFCE_PANEL_PLUGIN (plugin)) == GTK_ORIENTATION_VERTICAL
+                            ? GDK_GRAVITY_EAST : GDK_GRAVITY_SOUTH,
                             NULL);
 #else
   gtk_menu_popup (GTK_MENU (menu), NULL, NULL,

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list