summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/spiceqxl_main_loop.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/spiceqxl_main_loop.c b/src/spiceqxl_main_loop.c
index 1718861..e57fb91 100644
--- a/src/spiceqxl_main_loop.c
+++ b/src/spiceqxl_main_loop.c
@@ -315,9 +315,24 @@ static void select_and_check_watches(void)
}
}
+static int no_write_watches(Ring *w)
+{
+ SpiceWatch *watch;
+ RingItem *link;
+ RingItem *next;
+
+ RING_FOREACH_SAFE(link, next, w) {
+ watch = (SpiceWatch*)link;
+ if (!watch->remove && (watch->event_mask & SPICE_WATCH_EVENT_WRITE))
+ return 0;
+ }
+
+ return 1;
+}
+
static void xspice_wakeup_handler(pointer data, int nfds, pointer readmask)
{
- if (!nfds) {
+ if (!nfds && no_write_watches(&watches)) {
return;
}
select_and_check_watches();