Commit 7f9fba8b authored by Bastien Nocera's avatar Bastien Nocera
Browse files

idle-monitor: Reset the alarm so it can be triggered again

http://www.x.org/archive/X11R7.6/doc/xextproto/sync.txt says:

[... If] the delta is 0 and test-type is PositiveComparison
or NegativeComparison, no change is made to value and the alarm
state is changed to Inactive before the event is generated.

But we want to receive to receive events about the idleness/business
of the counter, so reset the alarm when the alarm is triggered.

https://bugzilla.gnome.org/show_bug.cgi?id=688227
parent bb3628db
......@@ -143,11 +143,12 @@ handle_alarm_notify_event (GnomeIdleMonitor *monitor,
if (alarm_event->alarm == monitor->priv->xalarm_reset) {
g_signal_emit (monitor, signals[BECAME_ACTIVE], 0);
} else {
GnomeIdleMonitorWatch *watch = find_watch_for_alarm (monitor, alarm_event->alarm);
GnomeIdleMonitorWatch *watch;
XSyncAlarmAttributes attr;
if (watch == NULL) {
watch = find_watch_for_alarm (monitor, alarm_event->alarm);
if (watch == NULL)
return;
}
g_signal_emit (monitor, signals[TRIGGERED_IDLE], 0, watch->id);
......@@ -156,6 +157,10 @@ handle_alarm_notify_event (GnomeIdleMonitor *monitor,
watch->id,
watch->user_data);
}
/* Reset the alarm so it can be triggered again */
attr.events = TRUE;
XSyncChangeAlarm (watch->display, watch->xalarm, XSyncCAEvents, &attr);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment