summaryrefslogtreecommitdiff
path: root/cpufreq/src
diff options
context:
space:
mode:
authorlukefromdc <[email protected]>2015-10-15 00:33:34 -0400
committerraveit65 <[email protected]>2015-10-16 16:19:10 +0200
commit167c7c5652cc62e3346f5238e15acb3b4b0bcf9b (patch)
treedbb6d5db032153d3ab6ac0b237a737ced7326d16 /cpufreq/src
parentcd971d39fcafc1aa71df342060b039012f1e05af (diff)
downloadmate-applets-167c7c5652cc62e3346f5238e15acb3b4b0bcf9b.tar.bz2
mate-applets-167c7c5652cc62e3346f5238e15acb3b4b0bcf9b.tar.xz
GTK3 cpufreq: support custom panel themes
support custom panel themes in gtk3 builds. Include robust support for transparent themes in cases where gtk3 has issues properly detecting a compositing window manager, e.g compiz.
Diffstat (limited to 'cpufreq/src')
-rw-r--r--cpufreq/src/cpufreq-applet.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/cpufreq/src/cpufreq-applet.c b/cpufreq/src/cpufreq-applet.c
index ffb4c332..784d5512 100644
--- a/cpufreq/src/cpufreq-applet.c
+++ b/cpufreq/src/cpufreq-applet.c
@@ -543,7 +543,20 @@ cpufreq_applet_menu_popup (CPUFreqApplet *applet,
if (!menu)
return;
-
+
+#if GTK_CHECK_VERSION (3, 0, 0)
+ /*Set up theme and transparency support*/
+ 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,
cpufreq_applet_popup_position_menu,
(gpointer) applet,