fix duplicate scroll events

This commit is contained in:
hippoz 2023-04-26 16:26:17 +03:00
parent dc83e09f43
commit d636de027b
Signed by: hippoz
GPG key ID: 56C4E02A85F2FBED

View file

@ -428,7 +428,7 @@ static void window_process_xcb_event(UIWindow *window, xcb_generic_event_t *even
node_dispatch(window->root, UI_EVENT_RELAYOUT, 0, NULL); node_dispatch(window->root, UI_EVENT_RELAYOUT, 0, NULL);
window_invalidate_node(window, window->root); window_invalidate_node(window, window->root);
#ifdef _UI_DEBUG #ifdef _UI_DEBUG
node_dump(window->root, 0); //node_dump(window->root, 0);
#endif #endif
} }
end_clock(); end_clock();
@ -497,12 +497,14 @@ static void window_process_xcb_event(UIWindow *window, xcb_generic_event_t *even
} }
} }
UINode *n = node; if (!(ui_event == UI_EVENT_SCROLL && !state)) {
while (n) { UINode *n = node;
if (node_dispatch(n, ui_event, state, &delta) > 0) { while (n) {
break; if (node_dispatch(n, ui_event, state, &delta) > 0) {
break;
}
n = n->parent;
} }
n = n->parent;
} }
if (ui_event == UI_EVENT_BUTTON_LEFT_UPDATE) { if (ui_event == UI_EVENT_BUTTON_LEFT_UPDATE) {