diff options
author | lukefromdc <[email protected]> | 2015-10-13 23:15:48 -0400 |
---|---|---|
committer | raveit65 <[email protected]> | 2015-10-14 21:46:50 +0200 |
commit | 92bdf80b0c3a7b73ba4d807f777ae41f6f215bcc (patch) | |
tree | e476ecaa8ac7075518825aae03dab8c773503ab5 /src | |
parent | e0ba283e92aab71119a8398be1c2dc2f59a5998c (diff) | |
download | mate-power-manager-92bdf80b0c3a7b73ba4d807f777ae41f6f215bcc.tar.bz2 mate-power-manager-92bdf80b0c3a7b73ba4d807f777ae41f6f215bcc.tar.xz |
tray icon: support custom themes
support custom themes, include robust transparency support
even when wm is not properly identified by gtk as compositing
Diffstat (limited to 'src')
-rw-r--r-- | src/gpm-tray-icon.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gpm-tray-icon.c b/src/gpm-tray-icon.c index 967e4c2..ab595c8 100644 --- a/src/gpm-tray-icon.c +++ b/src/gpm-tray-icon.c @@ -333,6 +333,20 @@ gpm_tray_icon_create_menu (GpmTrayIcon *icon, guint32 timestamp) g_signal_connect (G_OBJECT (item), "activate", G_CALLBACK (gpm_tray_icon_show_preferences_cb), icon); gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); + +#if GTK_CHECK_VERSION (3, 0, 0) + /*Set up custom panel menu theme support-gtk3 only */ + GtkWidget *toplevel = gtk_widget_get_toplevel (menu); + /* Fix any failures of compiz/other wm's to communicate with gtk for transparency in menu theme */ + 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 /* about */ item = gtk_image_menu_item_new_from_stock (GTK_STOCK_ABOUT, NULL); |