This should fix a race condition where the Mod-key was not released
in time when starting i3lock using a key combination.
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
+#include <unistd.h>
#include <assert.h>
#include <err.h>
xcb_grab_keyboard_cookie_t kcookie;
xcb_grab_keyboard_reply_t *kreply;
- int tries = 1000;
+ int tries = 10000;
while (tries-- > 0) {
pcookie = xcb_grab_pointer(
free(preply);
break;
}
+
+ /* Make this quite a bit slower */
+ usleep(50);
}
while (tries-- > 0) {
free(kreply);
break;
}
+
+ /* Make this quite a bit slower */
+ usleep(50);
}
if (tries <= 0)