mirror of
https://github.com/glfw/glfw.git
synced 2026-01-11 15:23:17 +01:00
Wayland: Fix maximized state lost while hidden
If a window was created as maximized, or created as hidden and then iconified or maximized before first being shown, that state was lost and the window was shown as restored.
This commit is contained in:
@@ -702,6 +702,8 @@ static GLFWbool createNativeSurface(_GLFWwindow* window,
|
||||
window->wl.scale = 1;
|
||||
window->wl.title = _glfw_strdup(wndconfig->title);
|
||||
|
||||
window->wl.maximized = wndconfig->maximized;
|
||||
|
||||
window->wl.transparent = fbconfig->transparent;
|
||||
if (!window->wl.transparent)
|
||||
setOpaqueRegion(window);
|
||||
@@ -2003,10 +2005,12 @@ void _glfwRestoreWindowWayland(_GLFWwindow* window)
|
||||
{
|
||||
// We assume we are not minimized and acto only on maximization
|
||||
|
||||
if (window->wl.xdg.toplevel)
|
||||
if (window->wl.maximized)
|
||||
{
|
||||
if (window->wl.maximized)
|
||||
if (window->wl.xdg.toplevel)
|
||||
xdg_toplevel_unset_maximized(window->wl.xdg.toplevel);
|
||||
else
|
||||
window->wl.maximized = GLFW_FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2015,6 +2019,8 @@ void _glfwMaximizeWindowWayland(_GLFWwindow* window)
|
||||
{
|
||||
if (window->wl.xdg.toplevel)
|
||||
xdg_toplevel_set_maximized(window->wl.xdg.toplevel);
|
||||
else
|
||||
window->wl.maximized = GLFW_TRUE;
|
||||
}
|
||||
|
||||
void _glfwShowWindowWayland(_GLFWwindow* window)
|
||||
|
||||
Reference in New Issue
Block a user