From ba921ad3ef9f53ea6042ec96061a50d354c57790 Mon Sep 17 00:00:00 2001 From: lukefromdc Date: Sun, 28 May 2017 23:13:15 -0400 Subject: 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 --- applets/notification_area/status-notifier/sn-dbus-menu.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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, -- cgit v1.2.1