summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Userland/Libraries/LibGUI/Window.cpp8
-rw-r--r--Userland/Libraries/LibGUI/Window.h1
2 files changed, 7 insertions, 2 deletions
diff --git a/Userland/Libraries/LibGUI/Window.cpp b/Userland/Libraries/LibGUI/Window.cpp
index fb8bf8e679..7995d73671 100644
--- a/Userland/Libraries/LibGUI/Window.cpp
+++ b/Userland/Libraries/LibGUI/Window.cpp
@@ -167,6 +167,7 @@ void Window::show()
return IterationDecision::Continue;
});
+ set_maximized(m_maximized_when_windowless);
reified_windows->set(m_window_id, this);
Application::the()->did_create_window({});
update();
@@ -998,14 +999,17 @@ void Window::set_forced_shadow(bool shadow)
bool Window::is_maximized() const
{
if (!is_visible())
- return false;
+ return m_maximized_when_windowless;
return WindowServerConnection::the().is_maximized(m_window_id);
}
void Window::set_maximized(bool maximized)
{
- VERIFY(m_window_id != 0);
+ m_maximized_when_windowless = maximized;
+ if (!is_visible())
+ return;
+
WindowServerConnection::the().async_set_maximized(m_window_id, maximized);
}
diff --git a/Userland/Libraries/LibGUI/Window.h b/Userland/Libraries/LibGUI/Window.h
index a6dd2e872a..d406aea77b 100644
--- a/Userland/Libraries/LibGUI/Window.h
+++ b/Userland/Libraries/LibGUI/Window.h
@@ -269,6 +269,7 @@ private:
bool m_resizable { true };
Optional<Gfx::IntSize> m_resize_aspect_ratio {};
bool m_minimizable { true };
+ bool m_maximized_when_windowless { false };
bool m_fullscreen { false };
bool m_frameless { false };
bool m_forced_shadow { false };