This commit is contained in:
Kovid Goyal 2022-01-08 09:16:32 +05:30
parent 8de787a2f3
commit 1bfc46a24f
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -401,7 +401,7 @@ multi_click_count(Window *w, int button) {
static void static void
add_press(Window *w, int button, int modifiers) { add_press(Window *w, int button, int modifiers) {
if (button < 0 || button > (ssize_t)arraysz(w->click_queues)) return; if (button < 0 || button >= (ssize_t)arraysz(w->click_queues)) return;
modifiers &= ~GLFW_LOCK_MASK; modifiers &= ~GLFW_LOCK_MASK;
ClickQueue *q = &w->click_queues[button]; ClickQueue *q = &w->click_queues[button];
if (q->length == CLICK_QUEUE_SZ) { memmove(q->clicks, q->clicks + 1, sizeof(Click) * (CLICK_QUEUE_SZ - 1)); q->length--; } if (q->length == CLICK_QUEUE_SZ) { memmove(q->clicks, q->clicks + 1, sizeof(Click) * (CLICK_QUEUE_SZ - 1)); q->length--; }