diff --git a/src/window.c b/src/window.c index 2ca3393..014f4ec 100644 --- a/src/window.c +++ b/src/window.c @@ -1,4 +1,5 @@ #include "cairo.h" +#include "rect.h" #include "timeutil.h" #include "window.h" #include "node.h" @@ -10,6 +11,7 @@ #include #include #include +#include void _window_process_xcb_event(UIWindow *window, xcb_generic_event_t *event); @@ -168,6 +170,9 @@ void _window_process_xcb_event(UIWindow *window, xcb_generic_event_t *event) uint8_t event_type = event->response_type & ~0x80; switch (event_type) { case XCB_EXPOSE: { + xcb_expose_event_t *ev = (xcb_expose_event_t*)event; + UIRect region = { ev->x, ev->y, ev->width, ev->height }; + window->invalid_region = ui_rect_united(&window->invalid_region, ®ion); window_invalidate_node(window, window->root); break; } @@ -182,7 +187,6 @@ void _window_process_xcb_event(UIWindow *window, xcb_generic_event_t *event) window->root->rect.w = ev->width; window->root->rect.h = ev->height; node_dispatch(window->root, UI_EVENT_RELAYOUT, 0, NULL); - window_invalidate_node(window, window->root); node_dump(window->root, 0); } break;