1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-15 07:34:59 +00:00

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.
This commit is contained in:
thankyouverycool 2022-08-18 11:00:08 -04:00 committed by Andreas Kling
parent 609391b46e
commit 589572cfa4
15 changed files with 91 additions and 63 deletions

View file

@ -14,7 +14,6 @@ GitCommitDialog::GitCommitDialog(GUI::Window* parent)
{
resize(400, 260);
center_within(*parent);
set_modal(true);
set_title("Commit");
set_icon(parent->icon());