From: Pekka Paalanen <[email protected]> Ensure, that the resulting surface size is at least 1x1, even when destination size is not set and source size is zero. Previously this lead to zero surface size.
This can still happen due to wl_viewport.set(#, #, 0, 0, #, #) followed by wl_viewport.set_destination(-1, -1). Signed-off-by: Pekka Paalanen <[email protected]> --- src/compositor.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/compositor.c b/src/compositor.c index 5439a6b..d2373d9 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -1245,9 +1245,10 @@ weston_surface_set_size_from_buffer(struct weston_surface *surface) } if (vp->buffer.src_width != wl_fixed_from_int(-1)) { - surface_set_size(surface, - fixed_round_up_to_int(vp->buffer.src_width), - fixed_round_up_to_int(vp->buffer.src_height)); + int32_t w = fixed_round_up_to_int(vp->buffer.src_width); + int32_t h = fixed_round_up_to_int(vp->buffer.src_height); + + surface_set_size(surface, w ?: 1, h ?: 1); return; } -- 1.8.3.2 _______________________________________________ wayland-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/wayland-devel
