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)