summaryrefslogtreecommitdiff
path: root/mate-panel/panel-toplevel.c
diff options
context:
space:
mode:
authorlukefromdc <[email protected]>2016-01-19 16:57:33 -0500
committerWolfgang Ulbrich <[email protected]>2016-01-23 23:32:12 +0100
commite4d45d7212088f9ff5845135c83d21ef3042dda7 (patch)
treed4e850847edd8313390244bd3fb751a78642f97b /mate-panel/panel-toplevel.c
parent067dbe7b68fa625ea87ef6e259539fff2baaeaf7 (diff)
downloadmate-panel-e4d45d7212088f9ff5845135c83d21ef3042dda7.tar.bz2
mate-panel-e4d45d7212088f9ff5845135c83d21ef3042dda7.tar.xz
GTK3: More panel BG rendering bugfixes
Keep the .mate-panel-menu-bar and .gnome-panel-menu-bar style classes on the panel toplevel unconditionally. GTK Inspector showed that the toplevel was actually being themed by PanelWidget and not by PanelToplevel, causing multiple issues. This was why it was not possible to set an image or an alpha background in the GTK theme. The .mate-custom-panel-background style class was being applied to the toplevel, but not mate-panel-menu-bar and .gnome-panel-menu-bar . This was also why resetting the panel from a custom to a system background required restarting the panel. I found all of this because of a bug or changed feature (not sure which) in GTK 3.19.7 which prevented the panel from being themed at all. Fixing this right also fixes all the bugs mentioned above. First restart after setting a custom theme will sometimes but not reliably crash an applet, not sure if that is a pre-existing bug though. At any rate, setting ANY custom background was just broken by gtk3.19.7. don't know if they will fix that or we will have to. That one can wait.
Diffstat (limited to 'mate-panel/panel-toplevel.c')
-rw-r--r--mate-panel/panel-toplevel.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/mate-panel/panel-toplevel.c b/mate-panel/panel-toplevel.c
index d4ae5ea9..680ae42b 100644
--- a/mate-panel/panel-toplevel.c
+++ b/mate-panel/panel-toplevel.c
@@ -5000,6 +5000,15 @@ panel_toplevel_init (PanelToplevel *toplevel)
* happens with "alternative" window managers such as Sawfish or XFWM4.
*/
g_signal_connect(GTK_WIDGET(toplevel), "delete-event", G_CALLBACK(gtk_true), NULL);
+
+#if GTK_CHECK_VERSION (3, 0, 0)
+ /*ensure the panel BG can always be themed*/
+ /*Without this gtk3.19/20 cannot set the BG color and resetting the bg to system is not immediately applied*/
+ GtkStyleContext *context;
+ context = gtk_widget_get_style_context (toplevel);
+ gtk_style_context_add_class(context,"gnome-panel-menu-bar");
+ gtk_style_context_add_class(context,"mate-panel-menu-bar");
+#endif
}
PanelWidget *