瀏覽代碼

Wayland: Fix invalid size protocol error

This could happen when resizing a window with fallback decorations.

Fixes #2204
Camilla Löwy 1 年之前
父節點
當前提交
b61f3fc479
共有 3 個文件被更改,包括 6 次插入0 次删除
  1. 1 0
      CONTRIBUTORS.md
  2. 2 0
      README.md
  3. 3 0
      src/wl_window.c

+ 1 - 0
CONTRIBUTORS.md

@@ -168,6 +168,7 @@ video tutorials.
  - Pascal Muetschard
  - Pascal Muetschard
  - James Murphy
  - James Murphy
  - Julian Møller
  - Julian Møller
+ - Nat
  - NateIsStalling
  - NateIsStalling
  - ndogxj
  - ndogxj
  - F. Nedelec
  - F. Nedelec

+ 2 - 0
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: `CLOCK_MONOTONIC` was not correctly enabled
  - [Wayland] Bugfix: `GLFW_HOVERED` was true when the cursor was over any
  - [Wayland] Bugfix: `GLFW_HOVERED` was true when the cursor was over any
    fallback window decoration
    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: Termination would segfault if the IM had been destroyed
  - [X11] Bugfix: Any IM started after initialization would not be detected
  - [X11] Bugfix: Any IM started after initialization would not be detected
  - [Linux] Bugfix: Joystick evdev fds remained open in forks (#2446)
  - [Linux] Bugfix: Joystick evdev fds remained open in forks (#2446)

+ 3 - 0
src/wl_window.c

@@ -340,6 +340,9 @@ static void resizeFramebuffer(_GLFWwindow* window)
 
 
 static GLFWbool resizeWindow(_GLFWwindow* window, int width, int height)
 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)
     if (width == window->wl.width && height == window->wl.height)
         return GLFW_FALSE;
         return GLFW_FALSE;