summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlukefromdc <[email protected]>2015-08-30 00:57:30 -0400
committerraveit65 <[email protected]>2015-10-10 01:34:34 +0200
commitf046dace113d6b3f1b1b094b09374399951c68bd (patch)
treee713d57a5c956e6380c0b1d41825e0e5e4a4cc89
parente30ac32ad31ab1e6415356f31a38c329a2a17918 (diff)
downloadmate-panel-f046dace113d6b3f1b1b094b09374399951c68bd.tar.bz2
mate-panel-f046dace113d6b3f1b1b094b09374399951c68bd.tar.xz
menu.c: robust transparent theme support
Ensure any transparent menu theme works even when gtk3.16 or later fails to detect a compositing window manager. This work also present on applet.c and mate-panel-applet.c theme support commits. Main menus already follow .mate-panel-menu-bar .menu so no changes to that
-rw-r--r--mate-panel/menu.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/mate-panel/menu.c b/mate-panel/menu.c
index b2c6caa1..dfffce66 100644
--- a/mate-panel/menu.c
+++ b/mate-panel/menu.c
@@ -1016,10 +1016,17 @@ create_fake_menu (MateMenuTreeDirectory *directory)
g_signal_connect (menu, "button_press_event",
G_CALLBACK (menu_dummy_button_press_event), NULL);
-
+
+
+/* Fix any failures of compiz/other wm's to communicate with gtk for transparency */
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GtkWidget *toplevel = gtk_widget_get_toplevel (menu);
+ 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);
+#endif
return menu;
}
-
GtkWidget *
panel_image_menu_item_new (void)
{
@@ -1327,7 +1334,14 @@ create_applications_menu (const char *menu_file,
G_CALLBACK (remove_matemenu_tree_monitor), tree);
matemenu_tree_unref (tree);
-
+
+/*HACK Fix any failures of compiz/other wm's to communicate with gtk for transparency */
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GtkWidget *toplevel = gtk_widget_get_toplevel (menu);
+ 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);
+#endif
return menu;
}