From db06aea1714facb3e1b789f18f3a5bf44adc0b96 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Fri, 13 May 2022 07:28:33 -0500 Subject: [PATCH] desktop-shell: Check height instead of checking width a second time Fix an apparent copy and paste error in resize code. I'm not sure anything sets the relevant callback that would lead to height being different than width, so there's no easy way to demonstrate a bug, but this change appears to rectify the intent of the code. Reported-by: Hideyuki Nagase Signed-off-by: Derek Foreman --- desktop-shell/shell.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c index 54469d3a..4641c030 100644 --- a/desktop-shell/shell.c +++ b/desktop-shell/shell.c @@ -1626,8 +1626,8 @@ resize_grab_motion(struct weston_pointer_grab *grab, width = max_size.width; if (height < min_size.height) height = min_size.height; - else if (max_size.width > 0 && width > max_size.width) - width = max_size.width; + else if (max_size.height > 0 && height > max_size.height) + height = max_size.height; weston_desktop_surface_set_size(shsurf->desktop_surface, width, height); }