1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 04:54:58 +00:00
serenity/Userland/Services/WindowServer/WindowMode.h
thankyouverycool 44049f5ad5 WindowServer: Catch more Window stealing misbehavior
Previously it was possible for a window to register as a parentless
blocking modal then add itself to a stealable parent's modal chain,
bypassing a mode misbehavior check in create_window()

Also relaxes reciprocity for blockers with the same parent. This
scenario is usually created by simultaneous MessageBoxes. It's not
an ideal UX to cascade these, but there's no need to crash over it.
2023-05-15 12:15:39 +02:00

25 lines
675 B
C++

/*
* Copyright (c) 2022, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
namespace WindowServer {
// WindowMode sets modal behavior for windows in a modal chain
//
// - Modeless: No modal effect (default mode for parentless windows)
// - Passive: Joins the modal chain but has no modal effect (default mode for child windows)
// - RenderAbove: Renders above its parent
// - Blocking: Preempts all interaction with its modal chain excepting descendants, sibling blockers, and popups (default mode for Dialogs)
enum class WindowMode {
Modeless = 0,
Passive,
RenderAbove,
Blocking,
_Count,
};
}