|
Lines 169-174
ck_tty_idle_monitor_get_property (GObject *object,
Link Here
|
| 169 |
static void |
169 |
static void |
| 170 |
remove_idle_hint_timeout (CkTtyIdleMonitor *tty_idle_monitor) |
170 |
remove_idle_hint_timeout (CkTtyIdleMonitor *tty_idle_monitor) |
| 171 |
{ |
171 |
{ |
|
|
172 |
g_debug ("remove_idle_hint_timeout: checking timeout_id %d", tty_idle_monitor->priv->timeout_id); |
| 172 |
if (tty_idle_monitor->priv->timeout_id > 0) { |
173 |
if (tty_idle_monitor->priv->timeout_id > 0) { |
| 173 |
g_source_remove (tty_idle_monitor->priv->timeout_id); |
174 |
g_source_remove (tty_idle_monitor->priv->timeout_id); |
| 174 |
tty_idle_monitor->priv->timeout_id = 0; |
175 |
tty_idle_monitor->priv->timeout_id = 0; |
|
Lines 225-230
check_tty_idle (CkTtyIdleMonitor *monitor)
Link Here
|
| 225 |
time_t idletime; |
226 |
time_t idletime; |
| 226 |
time_t last_access; |
227 |
time_t last_access; |
| 227 |
|
228 |
|
|
|
229 |
g_debug ("check_tty_idle: setting timeout_id %d to 0", monitor->priv->timeout_id); |
| 230 |
monitor->priv->timeout_id = 0; |
| 231 |
|
| 228 |
if (monitor->priv->device == NULL) { |
232 |
if (monitor->priv->device == NULL) { |
| 229 |
return FALSE; |
233 |
return FALSE; |
| 230 |
} |
234 |
} |
|
Lines 246-253
check_tty_idle (CkTtyIdleMonitor *monitor)
Link Here
|
| 246 |
|
250 |
|
| 247 |
tty_idle_monitor_set_idle_hint_internal (monitor, is_idle); |
251 |
tty_idle_monitor_set_idle_hint_internal (monitor, is_idle); |
| 248 |
|
252 |
|
| 249 |
monitor->priv->timeout_id = 0; |
|
|
| 250 |
|
| 251 |
if (is_idle) { |
253 |
if (is_idle) { |
| 252 |
if (! monitor_add_watch (monitor)) { |
254 |
if (! monitor_add_watch (monitor)) { |
| 253 |
/* if we can't add a watch just add a new timer */ |
255 |
/* if we can't add a watch just add a new timer */ |
|
Lines 275-280
static void
Link Here
|
| 275 |
schedule_tty_check (CkTtyIdleMonitor *monitor, |
277 |
schedule_tty_check (CkTtyIdleMonitor *monitor, |
| 276 |
guint seconds) |
278 |
guint seconds) |
| 277 |
{ |
279 |
{ |
|
|
280 |
g_debug ("schedule_tty_check: timeout_id %d", monitor->priv->timeout_id); |
| 278 |
if (monitor->priv->timeout_id == 0) { |
281 |
if (monitor->priv->timeout_id == 0) { |
| 279 |
#if GLIB_CHECK_VERSION(2,14,0) |
282 |
#if GLIB_CHECK_VERSION(2,14,0) |
| 280 |
monitor->priv->timeout_id = g_timeout_add_seconds (seconds, |
283 |
monitor->priv->timeout_id = g_timeout_add_seconds (seconds, |
|
Lines 285-290
schedule_tty_check (CkTtyIdleMonitor *monitor,
Link Here
|
| 285 |
(GSourceFunc)check_tty_idle, |
288 |
(GSourceFunc)check_tty_idle, |
| 286 |
monitor); |
289 |
monitor); |
| 287 |
#endif |
290 |
#endif |
|
|
291 |
g_debug ("schedule_tty_check: timeout_id %d", monitor->priv->timeout_id); |
| 288 |
} |
292 |
} |
| 289 |
} |
293 |
} |
| 290 |
|
294 |
|