From da61744ebf10b2517672449e8a8c2eb03e1f3879 Mon Sep 17 00:00:00 2001 From: lukefromdc Date: Tue, 18 Jul 2017 02:03:02 -0400 Subject: 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 --- libmate-panel-applet/mate-panel-applet-factory.c | 4 ++-- libmate-panel-applet/mate-panel-applet.c | 20 ++++++++++++-------- 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[] = "" "" "" - "" + "" "" - "" + "" "" "" ""; 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"); -- cgit v1.2.1