From b61f3fc4796a5b998d70aeb5e4723ea8b681403d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Thu, 15 Feb 2024 17:26:21 +0100 Subject: [PATCH] Wayland: Fix invalid size protocol error This could happen when resizing a window with fallback decorations. Fixes #2204 --- CONTRIBUTORS.md | 1 + README.md | 2 ++ src/wl_window.c | 3 +++ 3 files changed, 6 insertions(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 5f5c12f8..5d68bb77 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -168,6 +168,7 @@ video tutorials. - Pascal Muetschard - James Murphy - Julian Møller + - Nat - NateIsStalling - ndogxj - F. Nedelec diff --git a/README.md b/README.md index 948b3212..2d74ab8d 100644 --- a/README.md +++ b/README.md @@ -187,6 +187,8 @@ information on what to include when reporting a bug. - [Wayland] Bugfix: `CLOCK_MONOTONIC` was not correctly enabled - [Wayland] Bugfix: `GLFW_HOVERED` was true when the cursor was over any fallback window decoration + - [Wayland] Bugfix: Fallback decorations allowed resizing to invalid size + (#2204) - [X11] Bugfix: Termination would segfault if the IM had been destroyed - [X11] Bugfix: Any IM started after initialization would not be detected - [Linux] Bugfix: Joystick evdev fds remained open in forks (#2446) diff --git a/src/wl_window.c b/src/wl_window.c index ede4d659..a1f805cb 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -340,6 +340,9 @@ static void resizeFramebuffer(_GLFWwindow* window) static GLFWbool resizeWindow(_GLFWwindow* window, int width, int height) { + width = _glfw_max(width, 1); + height = _glfw_max(height, 1); + if (width == window->wl.width && height == window->wl.height) return GLFW_FALSE;