From 584ea0ac4d0397ddafb35089e2033fd32d4400bd Mon Sep 17 00:00:00 2001 From: hujianwei Date: Fri, 21 Oct 2022 03:29:15 +0000 Subject: [PATCH] Fix output computation when width and height are unspecified * output.c (XLUpdateSurfaceOutputs): Calculate width and height before checking if the surface is in the output region. --- output.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/output.c b/output.c index 19349aa..b37f3bc 100644 --- a/output.c +++ b/output.c @@ -781,17 +781,17 @@ XLUpdateSurfaceOutputs (Surface *surface, int x, int y, int width, int n, i; struct wl_resource *resource; - if (BoxContains (pixman_region32_extents (&surface->output_region), - x, y, width, height)) - /* The surface didn't move past the output region. */ - return; - if (width == -1) width = ViewWidth (surface->view); if (height == -1) height = ViewHeight (surface->view); + if (BoxContains (pixman_region32_extents (&surface->output_region), + x, y, width, height)) + /* The surface didn't move past the output region. */ + return; + /* TODO: store the number of outputs somewhere instead of hardcoding 256. */ n = ComputeSurfaceOutputs (x, y, width, height,