summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlukefromdc <[email protected]>2017-05-28 23:13:15 -0400
committermonsta <[email protected]>2017-06-11 16:12:09 +0300
commitba921ad3ef9f53ea6042ec96061a50d354c57790 (patch)
tree7131afb6ac482619590c57ab81c0f05447c0ea54
parent15f2b5650b00e947e49121bf9e9f31ffe9de4343 (diff)
downloadmate-panel-ba921ad3ef9f53ea6042ec96061a50d354c57790.tar.bz2
mate-panel-ba921ad3ef9f53ea6042ec96061a50d354c57790.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,