[Xfce4-commits] [apps/xfce4-terminal] 01/01: Fix tab activity indication

noreply at xfce.org noreply at xfce.org
Mon Sep 12 16:42:11 CEST 2016


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

f2404 pushed a commit to branch master
in repository apps/xfce4-terminal.

commit 971c86c5664d3db498552987595839c3fc89fca0
Author: Igor <f2404 at yandex.ru>
Date:   Mon Sep 12 17:42:05 2016 +0300

    Fix tab activity indication
---
 terminal/terminal-screen.c | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/terminal/terminal-screen.c b/terminal/terminal-screen.c
index 6a3bf97..01bf43d 100644
--- a/terminal/terminal-screen.c
+++ b/terminal/terminal-screen.c
@@ -1284,7 +1284,6 @@ static gboolean
 terminal_screen_reset_activity_timeout (gpointer user_data)
 {
   TerminalScreen *screen = TERMINAL_SCREEN (user_data);
-  GdkRGBA         color;
   GdkRGBA         active_color;
   GdkRGBA         fg_color;
 
@@ -1292,18 +1291,19 @@ terminal_screen_reset_activity_timeout (gpointer user_data)
     return FALSE;
 
   /* unset */
-  gtk_widget_override_color (screen->tab_label, GTK_STATE_FLAG_ACTIVE, NULL);
+  gtk_widget_override_color (screen->tab_label, gtk_widget_get_state_flags (screen->tab_label), NULL);
 
   if (terminal_preferences_get_color (screen->preferences, "tab-activity-color", &active_color))
     {
       /* calculate color between fg and active color */
       gtk_style_context_get_color (gtk_widget_get_style_context (screen->tab_label),
-                                   GTK_STATE_FLAG_ACTIVE, &fg_color);
-      color.red = (active_color.red + fg_color.red) / 2;
-      color.green = (active_color.green + fg_color.green) / 2;
-      color.blue = (active_color.blue + fg_color.blue) / 2;
+                                   gtk_widget_get_state_flags (screen->tab_label),
+                                   &fg_color);
+      active_color.red = (active_color.red + fg_color.red) / 2;
+      active_color.green = (active_color.green + fg_color.green) / 2;
+      active_color.blue = (active_color.blue + fg_color.blue) / 2;
 
-      gtk_widget_override_color (screen->tab_label, GTK_STATE_FLAG_ACTIVE, &color);
+      gtk_widget_override_color (screen->tab_label, gtk_widget_get_state_flags (screen->tab_label), &active_color);
     }
 
   return FALSE;
@@ -1332,7 +1332,7 @@ terminal_screen_vte_window_contents_changed (TerminalScreen *screen)
 
   /* leave if we should not start an update */
   if (screen->tab_label == NULL
-      || gtk_widget_get_state_flags (screen->tab_label) != GTK_STATE_FLAG_ACTIVE
+      || (gtk_widget_get_state_flags (screen->terminal) & GTK_STATE_FLAG_FOCUSED) != 0
       || time (NULL) - screen->activity_resize_time <= 1)
     return;
 
@@ -1343,8 +1343,9 @@ terminal_screen_vte_window_contents_changed (TerminalScreen *screen)
 
   /* set label color */
   has_color = terminal_preferences_get_color (screen->preferences, "tab-activity-color", &color);
-  gtk_widget_override_color (screen->tab_label, GTK_STATE_FLAG_ACTIVE, has_color ? &color : NULL);
-
+  gtk_widget_override_color (screen->tab_label,
+                             gtk_widget_get_state_flags (screen->tab_label),
+                             has_color ? &color : NULL);
 
   /* stop running reset timeout */
   if (screen->activity_timeout_id != 0)
@@ -2174,7 +2175,7 @@ terminal_screen_reset_activity (TerminalScreen *screen)
     g_source_remove (screen->activity_timeout_id);
 
   if (screen->tab_label != NULL)
-    gtk_widget_override_color (screen->tab_label, GTK_STATE_FLAG_ACTIVE, NULL);
+    gtk_widget_override_color (screen->tab_label, gtk_widget_get_state_flags (screen->tab_label), NULL);
 }
 
 

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


More information about the Xfce4-commits mailing list