From 589385aada2a09f4a0b85db407a88a8211254781 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Fri, 10 Jun 2022 14:10:25 +0200 Subject: [PATCH] Wayland: Fix glfwSetWindowSize resizing fs windows glfwSetWindowSize would change the size of fullscreen mode windows as if they were windowed mode. (cherry picked from commit 6857995498d6628b3052b547ecd7cdecfee342d6) --- README.md | 1 + src/wl_window.c | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b50afcd6..d51894ad 100644 --- a/README.md +++ b/README.md @@ -158,6 +158,7 @@ information on what to include when reporting a bug. inconsistent state - [Wayland] Bugfix: Window maximization events were not emitted - [Wayland] Bugfix: `glfwRestoreWindow` assumed it was always in windowed mode + - [Wayland] Bugfix: `glfwSetWindowSize` would resize a full screen window ## Contact diff --git a/src/wl_window.c b/src/wl_window.c index da63170d..c8a69291 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -548,7 +548,9 @@ static void xdgToplevelHandleConfigure(void* userData, } _glfwInputWindowSize(window, width, height); - _glfwPlatformSetWindowSize(window, width, height); + window->wl.width = width; + window->wl.height = height; + resizeWindow(window); _glfwInputWindowDamage(window); } @@ -1903,9 +1905,16 @@ void _glfwPlatformGetWindowSize(_GLFWwindow* window, int* width, int* height) void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height) { - window->wl.width = width; - window->wl.height = height; - resizeWindow(window); + if (window->monitor) + { + // Video mode setting is not available on Wayland + } + else + { + window->wl.width = width; + window->wl.height = height; + resizeWindow(window); + } } void _glfwPlatformSetWindowSizeLimits(_GLFWwindow* window,