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,6 +497,7 @@ static void window_process_xcb_event(UIWindow *window, xcb_generic_event_t *even
} }
} }
if (!(ui_event == UI_EVENT_SCROLL && !state)) {
UINode *n = node; UINode *n = node;
while (n) { while (n) {
if (node_dispatch(n, ui_event, state, &delta) > 0) { if (node_dispatch(n, ui_event, state, &delta) > 0) {
@ -504,6 +505,7 @@ static void window_process_xcb_event(UIWindow *window, xcb_generic_event_t *even
} }
n = n->parent; n = n->parent;
} }
}
if (ui_event == UI_EVENT_BUTTON_LEFT_UPDATE) { if (ui_event == UI_EVENT_BUTTON_LEFT_UPDATE) {
if (state) { if (state) {