From 8158e4c4155e15ea9442acd960a194376400788b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingo=20B=C3=BCrk?= Date: Fri, 17 Feb 2017 09:06:40 +0100 Subject: [PATCH] Copy the entire window content on Expose events. (#2685) With commit d58dbc3 we started ignoring Expose events in a sequence except for the last one. Since we only copied the affected part of the window in the Expose event handler, this caused incorrectly rendered window decorations. Instead of reverting to the old behavior, we now copy the entire window content on this single, last event with the following rationale: - It's cheaper to copy a larger chunk once than multiple smaller chunks doing one server roundtrip each. - That's how we do it when rendering out decoration on decoration changes as well. fixes #2683 --- src/handlers.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/handlers.c b/src/handlers.c index 315688c4..9fb9040e 100644 --- a/src/handlers.c +++ b/src/handlers.c @@ -614,12 +614,9 @@ static void handle_expose_event(xcb_expose_event_t *event) { } /* Since we render to our surface on every change anyways, expose events - * only tell us that the X server lost (parts of) the window contents. We - * can handle that by copying the appropriate part from our surface to the - * window. */ + * only tell us that the X server lost (parts of) the window contents. */ draw_util_copy_surface(&(parent->frame_buffer), &(parent->frame), - event->x, event->y, event->x, event->y, - event->width, event->height); + 0, 0, 0, 0, parent->rect.width, parent->rect.height); xcb_flush(conn); return; }