[Xfce4-commits] [xfce/xfce4-panel] 01/01: Get the actual widget state flags to avoid constant redraws (Bug #14307)

noreply at xfce.org noreply at xfce.org
Thu Mar 29 00:00:27 CEST 2018


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 c5e59cb2e28568629d62d5485ce97e9711b3ad84
Author: Viktor Semykin <thesame.ml at gmail.com>
Date:   Wed Mar 28 13:17:13 2018 -0500

    Get the actual widget state flags to avoid constant redraws (Bug #14307)
    
    In Gtk+3 default state for CSS context style is GTK_STATE_FLAG_DIR_LTR
    so every call to gtk_style_context_get_color with GTK_STATE_NORMAL
    changes its state internally and results in a redraw. By querying
    the state we avoid these useless CPU cycles.
---
 panel/panel-window.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/panel/panel-window.c b/panel/panel-window.c
index 78c45ca..49caae7 100644
--- a/panel/panel-window.c
+++ b/panel/panel-window.c
@@ -844,7 +844,7 @@ panel_window_draw (GtkWidget *widget,
   cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
 
   ctx = gtk_widget_get_style_context (widget);
-  gtk_style_context_get_color (ctx, GTK_STATE_NORMAL, &fg_rgba);
+  gtk_style_context_get_color (ctx, gtk_widget_get_state_flags(widget), &fg_rgba);
   dark_rgba = gdk_rgba_copy (&fg_rgba);
   fg_rgba.alpha = 0.5;
   dark_rgba->alpha = 0.15;

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


More information about the Xfce4-commits mailing list