diff -ru xfce4-cpu-freq-plugin-0.0.1.orig/panel-plugin/cpu-freq-dialogs.c xfce4-cpu-freq-plugin-0.0.1/panel-plugin/cpu-freq-dialogs.c --- xfce4-cpu-freq-plugin-0.0.1.orig/panel-plugin/cpu-freq-dialogs.c 2006-08-20 13:52:41.000000000 +0200 +++ xfce4-cpu-freq-plugin-0.0.1/panel-plugin/cpu-freq-dialogs.c 2009-04-02 11:13:08.846335911 +0200 @@ -22,9 +22,9 @@ #endif #define BORDER 4 -#define TIMEOUT_MIN 0.5 -#define TIMEOUT_MAX 3 -#define TIMEOUT_STEP 0.5 +#define TIMEOUT_MIN 1 +#define TIMEOUT_MAX 9 +#define TIMEOUT_STEP 1 #include "cpu-freq-plugin.h" #include "cpu-freq-dialogs.h" @@ -67,8 +67,9 @@ static void spinner_changed (GtkWidget *spinner, CpuFreqPluginConfigure *configure) { - gdouble timeout = gtk_spin_button_get_value (spinner); - timeout *= 100; + guint timeout = gtk_spin_button_get_value (spinner); + if (timeout == 0) + timeout = 1; cpuFreq->options->monitor_timeout = timeout; cpu_freq_restart_monitor_timeout_handle (); } @@ -148,7 +149,7 @@ TIMEOUT_MAX, TIMEOUT_STEP); gtk_spin_button_set_value (spinner, - (gdouble)cpuFreq->options->monitor_timeout / 100); + (gdouble)cpuFreq->options->monitor_timeout); gtk_box_pack_start (GTK_BOX (hbox), spinner, FALSE, FALSE, 0); g_signal_connect(G_OBJECT(spinner), "value-changed", diff -ru xfce4-cpu-freq-plugin-0.0.1.orig/panel-plugin/cpu-freq-plugin.c xfce4-cpu-freq-plugin-0.0.1/panel-plugin/cpu-freq-plugin.c --- xfce4-cpu-freq-plugin-0.0.1.orig/panel-plugin/cpu-freq-plugin.c 2006-08-20 13:52:41.000000000 +0200 +++ xfce4-cpu-freq-plugin-0.0.1/panel-plugin/cpu-freq-plugin.c 2009-04-02 12:16:25.655335794 +0200 @@ -234,7 +234,7 @@ cpu_freq_restart_monitor_timeout_handle (void) { g_source_remove (cpuFreq->timeoutHandle); - cpuFreq->timeoutHandle = g_timeout_add ( + cpuFreq->timeoutHandle = gtr_timeout_add_seconds ( cpuFreq->options->monitor_timeout, (GSourceFunc) file_modified, NULL); @@ -254,7 +254,7 @@ gboolean status; gint i; status = cpu_freq_start_monitor_timeout (); - cpuFreq->timeoutHandle = g_timeout_add ( + cpuFreq->timeoutHandle = gtr_timeout_add_seconds ( cpuFreq->options->monitor_timeout, (GSourceFunc) file_modified, NULL); @@ -278,7 +278,7 @@ cpuFreq->options->cpu_number = xfce_rc_read_int_entry (rc, "cpu_number", 0); cpuFreq->options->monitor_timeout = - xfce_rc_read_int_entry (rc, "monitor_timeout", 100); + xfce_rc_read_int_entry (rc, "monitor_timeout", 1); cpuFreq->options->show_icon = xfce_rc_read_bool_entry (rc, "show_icon", TRUE); cpuFreq->options->show_label_freq = @@ -394,4 +394,16 @@ G_CALLBACK (cpu_freq_configure), NULL); } +guint +gtr_timeout_add_seconds(guint interval, + GSourceFunc function, + gpointer data) +{ + #if GLIB_CHECK_VERSION( 2,14,0 ) + return g_timeout_add_seconds(interval, function, data); + #else + return g_timeout_add(interval*1000, function, data); + #endif +} + XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL (cpu_freq_construct); diff -ru xfce4-cpu-freq-plugin-0.0.1.orig/panel-plugin/cpu-freq-plugin.h xfce4-cpu-freq-plugin-0.0.1/panel-plugin/cpu-freq-plugin.h --- xfce4-cpu-freq-plugin-0.0.1.orig/panel-plugin/cpu-freq-plugin.h 2006-08-20 13:52:41.000000000 +0200 +++ xfce4-cpu-freq-plugin-0.0.1/panel-plugin/cpu-freq-plugin.h 2009-04-02 12:15:54.554335865 +0200 @@ -78,6 +78,11 @@ void cpu_freq_restart_monitor_timeout_handle (void); +guint +gtr_timeout_add_seconds(guint interval, + GSourceFunc function, + gpointer data); + G_END_DECLS #endif /* _CPU_FREQ_H */ Only in xfce4-cpu-freq-plugin-0.0.1: reason