From 159b87718b6765f014295fbe9d1e645df31d42df Mon Sep 17 00:00:00 2001 From: Aleksandrs Stier Date: Sat, 6 Apr 2024 14:56:05 +0200 Subject: 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. --- main.c | 1 + 1 file changed, 1 insertion(+) 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); } -- cgit v1.2.3