diff --git a/README.md b/README.md index c1b9b2c4..881a7bb4 100644 --- a/README.md +++ b/README.md @@ -154,6 +154,9 @@ information on what to include when reporting a bug. - [Wayland] Bugfix: A window leaving full screen mode ignored its desired size - [Wayland] Bugfix: `glfwSetWindowMonitor` did not update windowed mode size - [Wayland] Bugfix: `glfwRestoreWindow` would make a full screen window windowed + - [Wayland] Bugfix: A window maximized or restored by the user would enter an + inconsistent state + - [Wayland] Bugfix: Window maximization events were not emitted ## Contact diff --git a/src/wl_window.c b/src/wl_window.c index b35b7319..e86f69b7 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -558,7 +558,13 @@ static void xdgToplevelHandleConfigure(void* userData, _glfwPlatformIconifyWindow(window); } + if (window->wl.maximized && !maximized) + _glfwInputWindowMaximize(window, GLFW_FALSE); + else if (maximized && !window->wl.maximized) + _glfwInputWindowMaximize(window, GLFW_TRUE); + window->wl.activated = activated; + window->wl.maximized = maximized; } static void xdgToplevelHandleClose(void* userData, @@ -1976,18 +1982,12 @@ void _glfwPlatformRestoreWindow(_GLFWwindow* window) // There is no way to unset minimized, or even to know if we are // minimized, so there is nothing to do here. } - - window->wl.maximized = GLFW_FALSE; } void _glfwPlatformMaximizeWindow(_GLFWwindow* window) { if (window->wl.xdg.toplevel) - { xdg_toplevel_set_maximized(window->wl.xdg.toplevel); - } - - window->wl.maximized = GLFW_TRUE; } void _glfwPlatformShowWindow(_GLFWwindow* window)