aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2020-10-02 01:55:46 +0200
committerPřemysl Eric Janouch <p@janouch.name>2020-10-02 01:55:46 +0200
commit9244d2b657e79d8ba3e4acc3eb5bbc3e018e8d42 (patch)
tree6f9e4c87ae4cfa93fccb6adbd45200a120d37947
parent4302fc4baf726834fc0d08fbc340b6690d1d1c36 (diff)
downloadwdmtg-9244d2b657e79d8ba3e4acc3eb5bbc3e018e8d42.tar.gz
wdmtg-9244d2b657e79d8ba3e4acc3eb5bbc3e018e8d42.tar.xz
wdmtg-9244d2b657e79d8ba3e4acc3eb5bbc3e018e8d42.zip
Write a start marker to the DB event table
-rw-r--r--wdmtg.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/wdmtg.c b/wdmtg.c
index 289b48d..b2a9d0b 100644
--- a/wdmtg.c
+++ b/wdmtg.c
@@ -540,11 +540,16 @@ generator_init(void)
g_free(subpath);
g_key_file_free(kf);
+ // Write a start marker so that we can reliably detect interruptions
+ struct event *event = g_slice_new0(struct event);
+ event->timestamp = -1;
+ g_async_queue_push(g.queue, event);
+
+ update_current_window();
+
gint64 timeout_ms = timeout * 1000;
gen.idle_timeout.hi = timeout_ms >> 32;
gen.idle_timeout.lo = timeout_ms;
-
- update_current_window();
set_idle_alarm(&gen.idle_alarm_inactive,
XCB_SYNC_TESTTYPE_POSITIVE_COMPARISON, gen.idle_timeout);