summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlukefromdc <[email protected]>2017-05-28 23:13:15 -0400
committerlukefromdc <[email protected]>2017-05-29 20:33:12 -0400
commitc27ba68a23fed89c9b9065c7ddd9cbfa3dee5095 (patch)
treea265a7cae6aaaca3bf8c99540deceb60831d225b
parent82cfd0a0827910464429f904a59ba86582ad8bc4 (diff)
downloadmate-panel-c27ba68a23fed89c9b9065c7ddd9cbfa3dee5095.tar.bz2
mate-panel-c27ba68a23fed89c9b9065c7ddd9cbfa3dee5095.tar.xz
status notifier: follow same menu theme as rest of panel
Support any menu theme set up for the panel's menus differing from the rest of the Gtk theme using the .mate-panel-menu-bar style class
-rw-r--r--applets/notification_area/status-notifier/sn-dbus-menu.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/applets/notification_area/status-notifier/sn-dbus-menu.c b/applets/notification_area/status-notifier/sn-dbus-menu.c
index 9cbab345..50cca5ba 100644
--- a/applets/notification_area/status-notifier/sn-dbus-menu.c
+++ b/applets/notification_area/status-notifier/sn-dbus-menu.c
@@ -352,10 +352,25 @@ static void
sn_dbus_menu_constructed (GObject *object)
{
SnDBusMenu *menu;
+ GtkWidget *toplevel;
+ GdkScreen *screen;
+ GdkVisual *visual;
+ GtkStyleContext *context;
G_OBJECT_CLASS (sn_dbus_menu_parent_class)->constructed (object);
menu = SN_DBUS_MENU (object);
+ /*Set up theme and transparency support*/
+ toplevel = gtk_widget_get_toplevel(GTK_WIDGET(menu));
+ /* Fix any failures of compiz/other wm's to communicate with gtk for transparency */
+ screen = gtk_widget_get_screen(GTK_WIDGET(toplevel));
+ 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 */
+ 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");
+
menu->name_id = g_bus_watch_name (G_BUS_TYPE_SESSION, menu->bus_name,
G_BUS_NAME_WATCHER_FLAGS_NONE,
name_appeared_cb, name_vanished_cb,