summaryrefslogtreecommitdiff
path: root/libmate-panel-applet/mate-panel-applet.c
diff options
context:
space:
mode:
authorWilliam Wold <[email protected]>2019-07-07 22:47:09 +0000
committerraveit65 <[email protected]>2019-07-09 19:23:11 +0200
commit9c3d35733b6c76fa0ab478b6ab738c6ebcce062c (patch)
tree873f949640da5d64f5c94b4a4f708a9bf46dd4ee /libmate-panel-applet/mate-panel-applet.c
parentdbdde3e384beae26cd71dcd0ef008b890675149d (diff)
downloadmate-panel-9c3d35733b6c76fa0ab478b6ab738c6ebcce062c.tar.bz2
mate-panel-9c3d35733b6c76fa0ab478b6ab738c6ebcce062c.tar.xz
Keep applet menus from covering up applets on Wayland
Diffstat (limited to 'libmate-panel-applet/mate-panel-applet.c')
-rw-r--r--libmate-panel-applet/mate-panel-applet.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/libmate-panel-applet/mate-panel-applet.c b/libmate-panel-applet/mate-panel-applet.c
index 7cbf2900..adb1d467 100644
--- a/libmate-panel-applet/mate-panel-applet.c
+++ b/libmate-panel-applet/mate-panel-applet.c
@@ -852,10 +852,26 @@ mate_panel_applet_menu_popup (MatePanelApplet *applet,
context = gtk_widget_get_style_context (GTK_WIDGET(toplevel));
gtk_style_context_add_class(context,"gnome-panel-menu-bar");
gtk_style_context_add_class(context,"mate-panel-menu-bar");
+ GdkGravity widget_anchor = GDK_GRAVITY_NORTH_WEST;
+ GdkGravity menu_anchor = GDK_GRAVITY_NORTH_WEST;
+ switch (applet->priv->orient) {
+ case MATE_PANEL_APPLET_ORIENT_UP:
+ menu_anchor = GDK_GRAVITY_SOUTH_WEST;
+ break;
+ case MATE_PANEL_APPLET_ORIENT_DOWN:
+ widget_anchor = GDK_GRAVITY_SOUTH_WEST;
+ break;
+ case MATE_PANEL_APPLET_ORIENT_LEFT:
+ menu_anchor = GDK_GRAVITY_NORTH_EAST;
+ break;
+ case MATE_PANEL_APPLET_ORIENT_RIGHT:
+ widget_anchor = GDK_GRAVITY_NORTH_EAST;
+ break;
+ }
gtk_menu_popup_at_widget (GTK_MENU (menu),
GTK_WIDGET (applet),
- GDK_GRAVITY_NORTH_WEST,
- GDK_GRAVITY_NORTH_WEST,
+ widget_anchor,
+ menu_anchor,
event);
}