summaryrefslogtreecommitdiffstats
path: root/driver/timers.c
diff options
context:
space:
mode:
Diffstat (limited to 'driver/timers.c')
-rw-r--r--driver/timers.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/driver/timers.c b/driver/timers.c
index fc8b47a..591b568 100644
--- a/driver/timers.c
+++ b/driver/timers.c
@@ -689,6 +689,19 @@ swallow_unlock_typeahead_events (saver_info *si, XEvent *e)
memset (buf, 0, sizeof(buf));
}
+void
+flush_events (saver_info *si)
+{
+ int i;
+ XEvent xe;
+ for (i = 0; i < 10; ++i) {
+ while (XtAppPending (si->app) != 0) {
+ XtAppNextEvent (si->app, &xe);
+ dispatch_event (si, &xe);
+ }
+ usleep(5000);
+ }
+}
/* methods of detecting idleness: