summaryrefslogtreecommitdiff
path: root/libmate-panel-applet/mate-panel-applet.c
diff options
context:
space:
mode:
authorlukefromdc <[email protected]>2015-08-30 00:26:43 -0400
committerraveit65 <[email protected]>2015-10-10 01:34:33 +0200
commit8b3c651fbf92d3aa35b2e854aaa4468d43fccdf7 (patch)
treeef449a60b93db177ebcec5635223d8c9857ca1c2 /libmate-panel-applet/mate-panel-applet.c
parentfd3481221c0c73db85db2765e10cd431c3893ccd (diff)
downloadmate-panel-8b3c651fbf92d3aa35b2e854aaa4468d43fccdf7.tar.bz2
mate-panel-8b3c651fbf92d3aa35b2e854aaa4468d43fccdf7.tar.xz
custom menu theming support: mate-panel-applet.c
Make applet menus follow the .mate-panel-menu-bar .menu selector in the gtk theme, and the 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
Diffstat (limited to 'libmate-panel-applet/mate-panel-applet.c')
-rw-r--r--libmate-panel-applet/mate-panel-applet.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libmate-panel-applet/mate-panel-applet.c b/libmate-panel-applet/mate-panel-applet.c
index 72f3d595..260ef2bb 100644
--- a/libmate-panel-applet/mate-panel-applet.c
+++ b/libmate-panel-applet/mate-panel-applet.c
@@ -888,6 +888,20 @@ mate_panel_applet_menu_popup (MatePanelApplet *applet,
menu = gtk_ui_manager_get_widget (applet->priv->ui_manager,
"/MatePanelAppletPopup");
+
+/* Set up theme and transparency support */
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GtkWidget *toplevel = gtk_widget_get_toplevel (menu);
+/* 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
gtk_menu_popup (GTK_MENU (menu),
NULL, NULL,
(GtkMenuPositionFunc) mate_panel_applet_position_menu,