From 285f751bc8190e2a86715be83a8dbf34641e8f6c Mon Sep 17 00:00:00 2001 From: lukefromdc Date: Sun, 30 Aug 2015 01:02:09 -0400 Subject: 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. --- mate-panel/panel-context-menu.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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"); +#endif + return retval; } -- cgit v1.2.1