diff options
authorlukefromdc <[email protected]>2015-08-30 01:02:09 -0400
committerraveit65 <[email protected]>2015-10-10 01:34:34 +0200
commit285f751bc8190e2a86715be83a8dbf34641e8f6c (patch)
parentf046dace113d6b3f1b1b094b09374399951c68bd (diff)
panel-context-menu.c: custom menu theme support
Make the panel context menu follow the .mate-panel-menu-bar .menu selector in the gtk theme, and the panel context menu window follow the .mate-panel-menu-bar selector. Use the former to set a custom menu theme, the latter to alter or remove shadows from applet menus. Include robust support for transparent themes even with gtk does not detect a compositing window manager so long as compositing is enabled.
1 files changed, 14 insertions, 0 deletions
diff --git a/mate-panel/panel-context-menu.c b/mate-panel/panel-context-menu.c
index 49e8c9b2..b44ce112 100644
--- a/mate-panel/panel-context-menu.c
+++ b/mate-panel/panel-context-menu.c
@@ -314,5 +314,19 @@ panel_context_menu_create (PanelWidget *panel)
//FIXME: can we get rid of this? (needed by menu_get_panel())
g_object_set_data (G_OBJECT (retval), "menu_panel", panel);
+/* Set up theme and transparency support */
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GtkWidget *toplevel = gtk_widget_get_toplevel (retval);
+/* Fix any failures of compiz/other wm's to communicate with gtk for transparency */
+ GdkScreen *screen = gtk_widget_get_screen(GTK_WIDGET(toplevel));
+ GdkVisual *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 */
+ GtkStyleContext *context;
+ 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");
return retval;