From 9c3d35733b6c76fa0ab478b6ab738c6ebcce062c Mon Sep 17 00:00:00 2001 From: William Wold Date: Sun, 7 Jul 2019 22:47:09 +0000 Subject: Keep applet menus from covering up applets on Wayland --- libmate-panel-applet/mate-panel-applet.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'libmate-panel-applet') 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); } -- cgit v1.2.1