diff options
author | emersion <contact@emersion.fr> | 2018-01-27 21:49:40 +0100 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2018-01-27 21:49:40 +0100 |
commit | 861d5bdff2e33e453fdddc26cdeef2233c2f8ea7 (patch) | |
tree | 7699d540826101b6c9530fe1f05d47017f4fa6f3 | |
parent | 7adf13e2840bf57a2b96b73462fc7c6ca8e363da (diff) |
surface: fix damage when resizing a surface in QT apps
-rw-r--r-- | types/wlr_surface.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/types/wlr_surface.c b/types/wlr_surface.c index abe830f4..f93b2563 100644 --- a/types/wlr_surface.c +++ b/types/wlr_surface.c @@ -169,14 +169,13 @@ static bool wlr_surface_update_size(struct wlr_surface *surface, wl_list_init(&state->frame_callback_list); bool update_damage = false; - if (width < state->width) { - pixman_region32_union_rect(&state->surface_damage, &state->surface_damage, - width, 0, state->width - width, state->height); - update_damage = true; - } - if (height < state->height) { - pixman_region32_union_rect(&state->surface_damage, &state->surface_damage, - 0, height, state->width, state->height - height); + if (width != state->width || height != state->height) { + // Damage the whole surface on resize + // This isn't in the spec, but Weston does it and QT expects it + pixman_region32_union_rect(&state->surface_damage, + &state->surface_damage, 0, 0, state->width, state->height); + pixman_region32_union_rect(&state->surface_damage, + &state->surface_damage, 0, 0, width, height); update_damage = true; } |