summaryrefslogtreecommitdiff
path: root/libmate-panel-applet
diff options
context:
space:
mode:
authorlukefromdc <[email protected]>2017-07-18 02:03:02 -0400
committerlukefromdc <[email protected]>2017-08-13 14:37:24 -0400
commitda61744ebf10b2517672449e8a8c2eb03e1f3879 (patch)
tree9f9514d316793ebacc5a5d6aa406f7eaf022eb84 /libmate-panel-applet
parent94d8d911c873fce175b808e64addc89823252ffb (diff)
downloadmate-panel-da61744ebf10b2517672449e8a8c2eb03e1f3879.tar.bz2
mate-panel-da61744ebf10b2517672449e8a8c2eb03e1f3879.tar.xz
libmate-panel-applet GTK 3.14/3.16: fix custom bg w alpha
Draw the background only on out of process applets. This prevents double-draw of bg w alpha value on in-process applets with GTK 3.14/3/16 Also Fix indent
Diffstat (limited to 'libmate-panel-applet')
-rw-r--r--libmate-panel-applet/mate-panel-applet-factory.c4
-rw-r--r--libmate-panel-applet/mate-panel-applet.c20
2 files changed, 14 insertions, 10 deletions
diff --git a/libmate-panel-applet/mate-panel-applet-factory.c b/libmate-panel-applet/mate-panel-applet-factory.c
index fef1528c..cf2e6cba 100644
--- a/libmate-panel-applet/mate-panel-applet-factory.c
+++ b/libmate-panel-applet/mate-panel-applet-factory.c
@@ -241,9 +241,9 @@ static const gchar introspection_xml[] =
"<arg name='screen' type='i' direction='in'/>"
"<arg name='props' type='a{sv}' direction='in'/>"
"<arg name='applet' type='o' direction='out'/>"
- "<arg name='out-of-process' type='b' direction='out'/>"
+ "<arg name='out-of-process' type='b' direction='out'/>"
"<arg name='xid' type='u' direction='out'/>"
- "<arg name='uid' type='u' direction='out'/>"
+ "<arg name='uid' type='u' direction='out'/>"
"</method>"
"</interface>"
"</node>";
diff --git a/libmate-panel-applet/mate-panel-applet.c b/libmate-panel-applet/mate-panel-applet.c
index 5a46080e..04678823 100644
--- a/libmate-panel-applet/mate-panel-applet.c
+++ b/libmate-panel-applet/mate-panel-applet.c
@@ -1550,7 +1550,6 @@ mate_panel_applet_change_background(MatePanelApplet *applet,
cairo_pattern_t *pattern)
{
GtkStyleContext* context;
- MatePanelAppletOrient orientation;
GdkWindow* window;
#if GTK_CHECK_VERSION (3, 18, 0)
if (applet->priv->out_of_process)
@@ -1571,18 +1570,24 @@ mate_panel_applet_change_background(MatePanelApplet *applet,
}
break;
case PANEL_COLOR_BACKGROUND:
- gdk_window_set_background_rgba(window,color);
+ if (applet->priv->out_of_process){
+ gdk_window_set_background_rgba(window,color);
#if GTK_CHECK_VERSION (3, 18, 0)
- if (applet->priv->out_of_process)
- gtk_widget_queue_draw (applet->priv->plug); /*change the bg right away always */
+ gtk_widget_queue_draw (applet->priv->plug); /*change the bg right away always */
+#else
+ gtk_widget_queue_draw (GTK_WIDGET(applet));
#endif
+ }
break;
case PANEL_PIXMAP_BACKGROUND:
- gdk_window_set_background_pattern(window,pattern);
+ if (applet->priv->out_of_process){
+ gdk_window_set_background_pattern(window,pattern);
#if GTK_CHECK_VERSION (3, 18, 0)
- if (applet->priv->out_of_process)
- gtk_widget_queue_draw (applet->priv->plug); /*change the bg right away always */
+ gtk_widget_queue_draw (applet->priv->plug); /*change the bg right away always */
+#else
+ gtk_widget_queue_draw (GTK_WIDGET(applet));
#endif
+ }
break;
default:
g_assert_not_reached ();
@@ -1590,7 +1595,6 @@ mate_panel_applet_change_background(MatePanelApplet *applet,
}
if (applet->priv->out_of_process){
context = gtk_widget_get_style_context (GTK_WIDGET(applet->priv->plug));
- orientation = mate_panel_applet_get_orient (applet);
if (applet->priv->orient == MATE_PANEL_APPLET_ORIENT_UP ||
applet->priv->orient == MATE_PANEL_APPLET_ORIENT_DOWN){
gtk_style_context_add_class(context,"horizontal");