[Xfce4-commits] r30137 - terminal/trunk/terminal

Nick Schermer nick at xfce.org
Thu Jul 2 19:12:57 CEST 2009


Author: nick
Date: 2009-07-02 17:12:57 +0000 (Thu, 02 Jul 2009)
New Revision: 30137

Modified:
   terminal/trunk/terminal/terminal-preferences.c
   terminal/trunk/terminal/terminal-screen.c
Log:
Make the tab-activity-timeout property an uint.


Modified: terminal/trunk/terminal/terminal-preferences.c
===================================================================
--- terminal/trunk/terminal/terminal-preferences.c	2009-07-02 17:03:48 UTC (rev 30136)
+++ terminal/trunk/terminal/terminal-preferences.c	2009-07-02 17:12:57 UTC (rev 30137)
@@ -928,11 +928,11 @@
    **/
   g_object_class_install_property (gobject_class,
                                    PROP_TAB_ACTIVITY_TIMEOUT,
-                                   g_param_spec_double ("tab-activity-timeout",
-                                                        "tab-activity-timeout",
-                                                        "TabActivityTimeout",
-                                                        0.00, 30.00, 2.00,
-                                                        EXO_PARAM_READWRITE));
+                                   g_param_spec_uint ("tab-activity-timeout",
+                                                      "tab-activity-timeout",
+                                                      "TabActivityTimeout",
+                                                      0, 30, 2,
+                                                      EXO_PARAM_READWRITE));
 
   /**
    * TerminalPreferences:command-update-records:

Modified: terminal/trunk/terminal/terminal-screen.c
===================================================================
--- terminal/trunk/terminal/terminal-screen.c	2009-07-02 17:03:48 UTC (rev 30136)
+++ terminal/trunk/terminal/terminal-screen.c	2009-07-02 17:12:57 UTC (rev 30137)
@@ -916,7 +916,7 @@
 terminal_screen_vte_window_contents_changed (VteTerminal    *terminal,
                                              TerminalScreen *screen)
 {
-  gdouble  timeout;
+  guint    timeout;
   GdkColor color;
 
   terminal_return_if_fail (VTE_IS_TERMINAL (terminal));
@@ -925,13 +925,14 @@
   terminal_return_if_fail (TERMINAL_IS_PREFERENCES (screen->preferences));
 
   /* leave if we should not start an update */
-  if (GTK_WIDGET_STATE (screen->tab_label) != GTK_STATE_ACTIVE
+  if (screen->tab_label == NULL
+      || GTK_WIDGET_STATE (screen->tab_label) != GTK_STATE_ACTIVE
       || time (NULL) - screen->last_size_change <= 1)
     return;
 
   /* get the reset time, leave if this feature is disabled */
   g_object_get (G_OBJECT (screen->preferences), "tab-activity-timeout", &timeout, NULL);
-  if (timeout < 1.00)
+  if (timeout < 1)
     return;
 
   /* set label color */
@@ -944,7 +945,7 @@
 
   /* start new timeout to unset the activity */
   screen->activity_timeout_id =
-      g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (gint) timeout,
+      g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, timeout,
                                   terminal_screen_reset_activity_timeout,
                                   screen, terminal_screen_reset_activity_destroyed);
 }




More information about the Xfce4-commits mailing list