aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRouven Czerwinski <rouven@czerwinskis.de>2020-06-18 08:15:34 +0200
committerSimon Ser <contact@emersion.fr>2020-06-18 09:54:15 +0200
commitc18c419b56204dbec63e836101839c6d61cb9365 (patch)
treed851856cc689cafe1d6b5f1a8d86d24367529f81
parentc768309ab4b3d714bfb9ea80de09c5a6ea058a73 (diff)
surface: don't unset width and height in finalize
During surface finalization we may not have received a new buffer, resetting width and height in this case is wrong since we display the old buffer in this case.
-rw-r--r--types/wlr_surface.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/types/wlr_surface.c b/types/wlr_surface.c
index e4207d36..7011f698 100644
--- a/types/wlr_surface.c
+++ b/types/wlr_surface.c
@@ -174,16 +174,16 @@ static void surface_state_finalize(struct wlr_surface *surface,
}
}
- if (state->buffer_resource != NULL) {
- if (state->viewport.has_dst) {
+ if (state->viewport.has_dst) {
+ if (state->buffer_width == 0 && state->buffer_height == 0) {
+ state->width = state->height = 0;
+ } else {
state->width = state->viewport.dst_width;
state->height = state->viewport.dst_height;
- } else {
- surface_state_viewport_src_size(state,
- &state->width, &state->height);
}
} else {
- state->width = state->height = 0;
+ surface_state_viewport_src_size(state,
+ &state->width, &state->height);
}
pixman_region32_intersect_rect(&state->surface_damage,