[Xfce4-commits] [xfce/xfce4-panel] 01/01: panel: Don't tamper with leave_opacity value (Bug #16296)

noreply at xfce.org noreply at xfce.org
Wed Feb 5 23:36:48 CET 2020


This is an automated email from the git hooks/post-receive script.

o   c   h   o   s   i       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository xfce/xfce4-panel.

commit 563c1647f1917f6390397dd0998d99d067e98e63
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date:   Mon Feb 3 14:42:59 2020 +0100

    panel: Don't tamper with leave_opacity value (Bug #16296)
    
    Instead of changing the value of leave_opacity and remembering the
    original value when compositing changes, we just set the value
    to 1.0 when needed to avoid artifacts.
---
 panel/panel-base-window.c | 15 ++++++---------
 panel/panel-base-window.h |  1 -
 2 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/panel/panel-base-window.c b/panel/panel-base-window.c
index c508bf8..35a93fd 100644
--- a/panel/panel-base-window.c
+++ b/panel/panel-base-window.c
@@ -205,7 +205,6 @@ panel_base_window_init (PanelBaseWindow *window)
   window->background_rgba = NULL;
   window->enter_opacity = 1.00;
   window->leave_opacity = 1.00;
-  window->leave_opacity_old = 1.00;
 
   window->priv->css_provider = gtk_css_provider_new ();
   window->priv->borders = PANEL_BORDER_NONE;
@@ -523,8 +522,6 @@ panel_base_window_composited_changed (GdkScreen *screen,
 
   if (window->is_composited)
     {
-      if (window->leave_opacity != window->leave_opacity_old)
-        window->leave_opacity = window->leave_opacity_old;
       gtk_widget_set_opacity (GTK_WIDGET (widget), window->leave_opacity);
       panel_base_window_set_plugin_data (window,
                                          panel_base_window_set_plugin_leave_opacity);
@@ -532,11 +529,8 @@ panel_base_window_composited_changed (GdkScreen *screen,
     }
   else
     {
-      /* make sure that the leave opacity is always disabled without compositing, but
-         remember the original value so we can reset it if compositing gets re-enabled */
-      window->leave_opacity_old = window->leave_opacity;
-      window->leave_opacity = 1.0;
-      gtk_widget_set_opacity (GTK_WIDGET (widget), window->leave_opacity);
+      /* make sure to always disable the leave opacity without compositing */
+      gtk_widget_set_opacity (GTK_WIDGET (widget), 1.0);
       panel_base_window_set_plugin_data (window,
                                          panel_base_window_set_plugin_leave_opacity);
     }
@@ -755,7 +749,10 @@ panel_base_window_set_plugin_leave_opacity (GtkWidget *widget,
 {
   PanelBaseWindow *window = PANEL_BASE_WINDOW (user_data);
 
-  panel_base_window_set_plugin_opacity (widget, user_data, window->leave_opacity);
+  if (window->is_composited)
+    panel_base_window_set_plugin_opacity (widget, user_data, window->leave_opacity);
+  else
+    panel_base_window_set_plugin_opacity (widget, user_data, 1.0);
 }
 
 
diff --git a/panel/panel-base-window.h b/panel/panel-base-window.h
index 24f2f68..0e131a2 100644
--- a/panel/panel-base-window.h
+++ b/panel/panel-base-window.h
@@ -74,7 +74,6 @@ struct _PanelBaseWindow
   /* transparency settings */
   gdouble                  enter_opacity;
   gdouble                  leave_opacity;
-  gdouble                  leave_opacity_old;
 };
 
 GType        panel_base_window_get_type                    (void) G_GNUC_CONST;

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list