From fdc72edf8177f74b9565094559ebd0a717af93a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Sun, 19 Jun 2022 18:30:03 +0200 Subject: [PATCH] Wayland: Fix missing fullscreen code path glfwRestoreWindow assumed it was only called in windowed mode. --- README.md | 1 + src/wl_window.c | 14 +++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index df7cfa47..fd97d9bf 100644 --- a/README.md +++ b/README.md @@ -338,6 +338,7 @@ information on what to include when reporting a bug. - [Wayland] Bugfix: A window maximized or restored by the user would enter an inconsistent state - [Wayland] Bugfix: Window maximization events were not emitted + - [Wayland] Bugfix: `glfwRestoreWindow` assumed it was always in windowed mode - [POSIX] Removed use of deprecated function `gettimeofday` - [POSIX] Bugfix: `CLOCK_MONOTONIC` was not correctly tested for or enabled - [WGL] Disabled the DWM swap interval hack for Windows 8 and later (#1072) diff --git a/src/wl_window.c b/src/wl_window.c index 06a922cf..6d71a9aa 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -1912,13 +1912,21 @@ void _glfwIconifyWindowWayland(_GLFWwindow* window) void _glfwRestoreWindowWayland(_GLFWwindow* window) { - if (window->wl.xdg.toplevel) + if (window->monitor) { - if (window->wl.maximized) - xdg_toplevel_unset_maximized(window->wl.xdg.toplevel); // There is no way to unset minimized, or even to know if we are // minimized, so there is nothing to do in this case. } + else + { + // We assume we are not minimized and acto only on maximization + + if (window->wl.xdg.toplevel) + { + if (window->wl.maximized) + xdg_toplevel_unset_maximized(window->wl.xdg.toplevel); + } + } } void _glfwMaximizeWindowWayland(_GLFWwindow* window)