mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 22:57:34 +00:00
WindowServer: Add accessory windows
Accessory windows are windows that, when activated, will activate their parent and bring all other accessory windows of that parent to the front of the window stack. Accessory windows can only be active input windows. The accessory window's parent is always the active window regardless of whether it is also the active input window. In order to route input correctly, input is now sent to the active input window, which can be any accessory window or their parent, or any regular window.
This commit is contained in:
parent
396291b356
commit
ec3737510d
16 changed files with 216 additions and 59 deletions
|
@ -76,7 +76,7 @@ class Window final : public Core::Object
|
|||
, public InlineLinkedListNode<Window> {
|
||||
C_OBJECT(Window)
|
||||
public:
|
||||
Window(ClientConnection&, WindowType, int window_id, bool modal, bool minimizable, bool frameless, bool resizable, bool fullscreen);
|
||||
Window(ClientConnection&, WindowType, int window_id, bool modal, bool minimizable, bool frameless, bool resizable, bool fullscreen, bool accessory, Window* parent_window = nullptr);
|
||||
Window(Core::Object&, WindowType);
|
||||
virtual ~Window() override;
|
||||
|
||||
|
@ -240,6 +240,13 @@ public:
|
|||
Vector<WeakPtr<Window>>& child_windows() { return m_child_windows; }
|
||||
const Vector<WeakPtr<Window>>& child_windows() const { return m_child_windows; }
|
||||
|
||||
Vector<WeakPtr<Window>>& accessory_windows() { return m_accessory_windows; }
|
||||
const Vector<WeakPtr<Window>>& accessory_windows() const { return m_accessory_windows; }
|
||||
|
||||
void set_accessory(bool accessory) { m_accessory = accessory; }
|
||||
bool is_accessory() const { return m_accessory; }
|
||||
bool is_accessory_of(Window&) const;
|
||||
|
||||
void set_frameless(bool frameless) { m_frameless = frameless; }
|
||||
bool is_frameless() const { return m_frameless; }
|
||||
|
||||
|
@ -251,12 +258,14 @@ private:
|
|||
void update_menu_item_text(PopupMenuItem item);
|
||||
void update_menu_item_enabled(PopupMenuItem item);
|
||||
void add_child_window(Window&);
|
||||
void add_accessory_window(Window&);
|
||||
void ensure_window_menu();
|
||||
|
||||
ClientConnection* m_client { nullptr };
|
||||
|
||||
WeakPtr<Window> m_parent_window;
|
||||
Vector<WeakPtr<Window>> m_child_windows;
|
||||
Vector<WeakPtr<Window>> m_accessory_windows;
|
||||
|
||||
String m_title;
|
||||
Gfx::IntRect m_rect;
|
||||
|
@ -275,6 +284,7 @@ private:
|
|||
bool m_minimized { false };
|
||||
bool m_maximized { false };
|
||||
bool m_fullscreen { false };
|
||||
bool m_accessory { false };
|
||||
WindowTileType m_tiled { WindowTileType::None };
|
||||
Gfx::IntRect m_untiled_rect;
|
||||
bool m_occluded { false };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue