From 589572cfa44308c4cfc62f366e95c97c7e6cdc9c Mon Sep 17 00:00:00 2001 From: thankyouverycool <66646555+thankyouverycool@users.noreply.github.com> Date: Thu, 18 Aug 2022 11:00:08 -0400 Subject: LibGUI+WindowServer: Introduce WindowModes Previously, Windows only understood blocking modality: Windows were either modal, i.e., in a blocking state, or not. Windows could also be set as Accessories or ToolWindows, attributes which technically applied modes to their parents but were implemented ad hoc. This patch redefines these modal effects as WindowModes and sets up some helpers. This will let us simplify a lot of modal logic in the upcoming patches and make it easier to build new modal effects in the future. Windows can now set 1 of 5 modes before reification: -Modeless: No modal effect; begins a new modal chain -Passive: Window joins its modal chain but has no effect -RenderAbove: Window renders above its parent -CaptureInput: Window captures the active input role from its parent -Blocking: Window blocks all interaction with its modal chain States like fullscreen and tiling are dynamic and don't alter behavior in modal chains, so they aren't included. --- Userland/Libraries/LibGUI/Dialog.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Userland/Libraries/LibGUI/Dialog.cpp') diff --git a/Userland/Libraries/LibGUI/Dialog.cpp b/Userland/Libraries/LibGUI/Dialog.cpp index dc99915274..f9281082fa 100644 --- a/Userland/Libraries/LibGUI/Dialog.cpp +++ b/Userland/Libraries/LibGUI/Dialog.cpp @@ -17,8 +17,7 @@ Dialog::Dialog(Window* parent_window, ScreenPosition screen_position) : Window(parent_window) , m_screen_position(screen_position) { - set_modal(true); - set_minimizable(false); + set_window_mode(WindowMode::Blocking); } Dialog::ExecResult Dialog::exec() -- cgit v1.2.3