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
This commit is contained in:
Ingo Bürk 2017-02-17 09:06:40 +01:00 committed by Michael Stapelberg
parent ad9c879cbd
commit 8158e4c415
1 changed files with 2 additions and 5 deletions

View File

@ -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 /* 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 * only tell us that the X server lost (parts of) the window contents. */
* can handle that by copying the appropriate part from our surface to the
* window. */
draw_util_copy_surface(&(parent->frame_buffer), &(parent->frame), draw_util_copy_surface(&(parent->frame_buffer), &(parent->frame),
event->x, event->y, event->x, event->y, 0, 0, 0, 0, parent->rect.width, parent->rect.height);
event->width, event->height);
xcb_flush(conn); xcb_flush(conn);
return; return;
} }