diff options
author | lukefromdc <[email protected]> | 2018-10-29 16:00:28 -0400 |
---|---|---|
committer | lukefromdc <[email protected]> | 2018-10-29 16:00:28 -0400 |
commit | 105f685f3c11a6096f6396f9282ce8eb8ecf7920 (patch) | |
tree | a2958aa41449a8b30e262413513ae244a32e107a | |
parent | d68268a7200b0f9ecf93566f1da9beca58ca4c1d (diff) | |
download | mate-panel-105f685f3c11a6096f6396f9282ce8eb8ecf7920.tar.bz2 mate-panel-105f685f3c11a6096f6396f9282ce8eb8ecf7920.tar.xz |
Ensure alt-F1 can show the menu even if no menu applet on panel
Fix regression introduced by https://github.com/mate-desktop/mate-panel/commit/17ac8aab4d139cb917619a3a981300f51b750c17 and ensure that menu shown follows same theme as menu shown from panel menu button or panel menu bar
-rw-r--r-- | mate-panel/panel-action-protocol.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/mate-panel/panel-action-protocol.c b/mate-panel/panel-action-protocol.c index c6f3e82a..3951e63c 100644 --- a/mate-panel/panel-action-protocol.c +++ b/mate-panel/panel-action-protocol.c @@ -50,11 +50,14 @@ static Atom atom_mate_panel_action_kill_dialog = None; static void panel_action_protocol_main_menu (GdkScreen *screen, - guint32 activate_time) + guint32 activate_time, GdkEvent *event) { PanelWidget *panel_widget; GtkWidget *menu; AppletInfo *info; + GdkVisual *visual; + GtkWidget *toplevel; + GtkStyleContext *context; info = mate_panel_applet_get_by_type (PANEL_OBJECT_MENU_BAR, screen); if (info) { @@ -76,7 +79,16 @@ panel_action_protocol_main_menu (GdkScreen *screen, panel_toplevel_push_autohide_disabler (panel_widget->toplevel); gtk_menu_set_screen (GTK_MENU (menu), screen); - gtk_menu_popup_at_pointer (GTK_MENU (menu), NULL); +/* Set up theme and transparency support */ + toplevel = gtk_widget_get_toplevel (menu); +/* Fix any failures of compiz/other wm's to communicate with gtk for transparency */ + visual = gdk_screen_get_rgba_visual(screen); + gtk_widget_set_visual(GTK_WIDGET(toplevel), visual); +/* Set menu and it's toplevel window to follow panel theme */ + 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"); + gtk_menu_popup_at_pointer (GTK_MENU (menu),event); } static void @@ -120,11 +132,11 @@ panel_action_protocol_filter (GdkXEvent *gdk_xevent, return GDK_FILTER_CONTINUE; if (xevent->xclient.data.l [0] == atom_mate_panel_action_main_menu) - panel_action_protocol_main_menu (screen, xevent->xclient.data.l [1]); + panel_action_protocol_main_menu (screen, xevent->xclient.data.l [1], event); else if (xevent->xclient.data.l [0] == atom_mate_panel_action_run_dialog) panel_action_protocol_run_dialog (screen, xevent->xclient.data.l [1]); else if (xevent->xclient.data.l [0] == atom_gnome_panel_action_main_menu) - panel_action_protocol_main_menu (screen, xevent->xclient.data.l [1]); + panel_action_protocol_main_menu (screen, xevent->xclient.data.l [1], event); else if (xevent->xclient.data.l [0] == atom_gnome_panel_action_run_dialog) panel_action_protocol_run_dialog (screen, xevent->xclient.data.l [1]); else if (xevent->xclient.data.l [0] == atom_mate_panel_action_kill_dialog) |