From 15050f5711027cc891fcb491da14a5a811eb0081 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. (cherry picked from commit fdc72edf8177f74b9565094559ebd0a717af93a0) --- README.md | 1 + src/wl_window.c | 14 +++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 881a7bb4..b50afcd6 100644 --- a/README.md +++ b/README.md @@ -157,6 +157,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 ## Contact diff --git a/src/wl_window.c b/src/wl_window.c index e86f69b7..da63170d 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -1975,13 +1975,21 @@ void _glfwPlatformIconifyWindow(_GLFWwindow* window) void _glfwPlatformRestoreWindow(_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 here. } + 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 _glfwPlatformMaximizeWindow(_GLFWwindow* window)