aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorAleksandrs Stier <aleks.stier@icloud.com>2024-04-06 14:56:05 +0200
committerAleksandrs Stier <aleks.stier@icloud.com>2024-04-06 15:20:36 +0200
commit159b87718b6765f014295fbe9d1e645df31d42df (patch)
tree316f8502ca2bff7dd40e2fa834a20417c8e2249c /main.c
parent4633c1e57389e49324302246a611766aa043ecf4 (diff)
fix: cursor becomes hidden forever #26
If multiple keys are pressed and the mouse is moved simultaneously it can cause the cursor to become hidden forever. This is because if multiple keys are pressed very fast and the mouse moves at the same time the X-Server generates respective events before xhidecursor is finished processing the first event and changing the selected event-type. This causes undefined states. To fix that synchronize the X-Server with xhidecursor and discard all events from the event-queue after finishing processing an event.
Diffstat (limited to 'main.c')
-rw-r--r--main.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/main.c b/main.c
index d80e968..b5a0ed0 100644
--- a/main.c
+++ b/main.c
@@ -40,6 +40,7 @@ int main(void) {
break;
}
XFreeEventData(d, c);
+ XSync(d, True);
}
XCloseDisplay(d);
}