[gnome-panel/wip-geiger-popup-menu: 2/2] panel-applet-private: use gp_applet_popup_menu_at_widget



commit 078574d41b417e6d1fff210b2e5f2ab07c4aab85
Author: Sebastian Geiger <sbastig gmx net>
Date:   Sun Apr 5 22:09:36 2020 +0200

    panel-applet-private: use gp_applet_popup_menu_at_widget

 .../libpanel-applet-private/gp-applet-frame.c      | 49 +++-------------------
 1 file changed, 5 insertions(+), 44 deletions(-)
---
diff --git a/gnome-panel/libpanel-applet-private/gp-applet-frame.c 
b/gnome-panel/libpanel-applet-private/gp-applet-frame.c
index a8a8c5a1c..7dbdc5272 100644
--- a/gnome-panel/libpanel-applet-private/gp-applet-frame.c
+++ b/gnome-panel/libpanel-applet-private/gp-applet-frame.c
@@ -35,51 +35,12 @@ static void
 popup_menu (GtkMenu  *menu,
             GpApplet *applet)
 {
-  GtkOrientation orientation;
-  GtkPositionType position;
-  GdkGravity widget_anchor;
-  GdkGravity menu_anchor;
-
-  orientation = gp_applet_get_orientation (applet);
-  position = gp_applet_get_position (applet);
-
-  widget_anchor = GDK_GRAVITY_SOUTH_WEST;
-  menu_anchor = GDK_GRAVITY_NORTH_WEST;
-
-  if (orientation == GTK_ORIENTATION_HORIZONTAL)
-    {
-      if (position == GTK_POS_TOP)
-        {
-          widget_anchor = GDK_GRAVITY_SOUTH_WEST;
-          menu_anchor = GDK_GRAVITY_NORTH_WEST;
-        }
-      else if (position == GTK_POS_BOTTOM)
-        {
-          widget_anchor = GDK_GRAVITY_NORTH_WEST;
-          menu_anchor = GDK_GRAVITY_SOUTH_WEST;
-        }
-      else
-        g_assert_not_reached ();
-    }
-  else
-    {
-      if (position == GTK_POS_LEFT)
-        {
-          widget_anchor = GDK_GRAVITY_NORTH_EAST;
-          menu_anchor = GDK_GRAVITY_NORTH_WEST;
-        }
-      else if (position == GTK_POS_RIGHT)
-        {
-          widget_anchor = GDK_GRAVITY_NORTH_WEST;
-          menu_anchor = GDK_GRAVITY_NORTH_EAST;
-        }
-      else
-        g_assert_not_reached ();
-    }
-
   gtk_menu_attach_to_widget (menu, GTK_WIDGET (applet), NULL);
-  gtk_menu_popup_at_widget (menu, GTK_WIDGET (applet),
-                            widget_anchor, menu_anchor, NULL);
+
+  gp_applet_popup_menu_at_widget (applet,
+                                  menu,
+                                  GTK_WIDGET (applet),
+                                  NULL);
 }
 
 static void


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