proper invalidation on Expose xcb event
This commit is contained in:
parent
793918f86f
commit
68211499e8
1 changed files with 5 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
||||||
#include "cairo.h"
|
#include "cairo.h"
|
||||||
|
#include "rect.h"
|
||||||
#include "timeutil.h"
|
#include "timeutil.h"
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
#include "node.h"
|
#include "node.h"
|
||||||
|
@ -10,6 +11,7 @@
|
||||||
#include <sys/poll.h>
|
#include <sys/poll.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <xcb/xcb.h>
|
#include <xcb/xcb.h>
|
||||||
|
#include <xcb/xproto.h>
|
||||||
|
|
||||||
void _window_process_xcb_event(UIWindow *window, xcb_generic_event_t *event);
|
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;
|
uint8_t event_type = event->response_type & ~0x80;
|
||||||
switch (event_type) {
|
switch (event_type) {
|
||||||
case XCB_EXPOSE: {
|
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);
|
window_invalidate_node(window, window->root);
|
||||||
break;
|
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.w = ev->width;
|
||||||
window->root->rect.h = ev->height;
|
window->root->rect.h = ev->height;
|
||||||
node_dispatch(window->root, UI_EVENT_RELAYOUT, 0, NULL);
|
node_dispatch(window->root, UI_EVENT_RELAYOUT, 0, NULL);
|
||||||
window_invalidate_node(window, window->root);
|
|
||||||
node_dump(window->root, 0);
|
node_dump(window->root, 0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue