diff options
author | lukefromdc <[email protected]> | 2015-10-15 00:19:23 -0400 |
---|---|---|
committer | raveit65 <[email protected]> | 2015-10-16 16:19:10 +0200 |
commit | 7b3bf0dc42c752c4403e1fec4778e42e58914388 (patch) | |
tree | 959c3a546a57157f66e4f3b5fec94e0f8a3e8061 /drivemount/drive-button.c | |
parent | 554c6897ba818ee2384da8b5d4f54ac8a33ab1cd (diff) | |
download | mate-applets-7b3bf0dc42c752c4403e1fec4778e42e58914388.tar.bz2 mate-applets-7b3bf0dc42c752c4403e1fec4778e42e58914388.tar.xz |
GTK3 drivemount: support custom panel themes
support custom panel themes in gtk3 builds. Includes robust support
for transparent themes even when gtk3 has issues properly detecting
a compositing window manager e.g. compiz.
Diffstat (limited to 'drivemount/drive-button.c')
-rw-r--r-- | drivemount/drive-button.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivemount/drive-button.c b/drivemount/drive-button.c index 2ca86acf..5bd420fd 100644 --- a/drivemount/drive-button.c +++ b/drivemount/drive-button.c @@ -989,4 +989,19 @@ drive_button_ensure_popup (DriveButton *self) g_free (label); gtk_container_add (GTK_CONTAINER (self->popup_menu), item); } + +#if GTK_CHECK_VERSION (3, 0, 0) + /*Set up custom theme and transparency support */ + GtkWidget *toplevel = gtk_widget_get_toplevel (self->popup_menu); + /* Fix any failures of compiz/other wm's to communicate with gtk for transparency */ + GdkScreen *screen2 = gtk_widget_get_screen(GTK_WIDGET(toplevel)); + GdkVisual *visual = gdk_screen_get_rgba_visual(screen2); + 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_remove_class (context,GTK_STYLE_CLASS_BACKGROUND); + gtk_style_context_add_class(context,"gnome-panel-menu-bar"); + gtk_style_context_add_class(context,"mate-panel-menu-bar"); +#endif } |