From 92bdf80b0c3a7b73ba4d807f777ae41f6f215bcc Mon Sep 17 00:00:00 2001 From: lukefromdc Date: Tue, 13 Oct 2015 23:15:48 -0400 Subject: tray icon: support custom themes support custom themes, include robust transparency support even when wm is not properly identified by gtk as compositing --- src/gpm-tray-icon.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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); -- cgit v1.2.1