1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:07:36 +00:00

WindowServer: Allow windows to be pinnable (always on top)

This patch adds the concept of a window being "Pinnable" (always drawn
on top of other windows). This can be toggled through a new checkable
action in the top left corner's window menu.
This commit is contained in:
Andres Crucitti 2021-07-06 00:15:26 -07:00 committed by Andreas Kling
parent d5722eab36
commit f6f14777ac
7 changed files with 87 additions and 0 deletions

View file

@ -56,6 +56,7 @@ enum class WindowMenuAction {
ToggleMenubarVisibility,
Close,
Move,
TogglePinned,
};
enum class WindowMenuDefaultAction {
@ -103,6 +104,9 @@ public:
bool is_maximized() const { return m_maximized; }
void set_maximized(bool, Optional<Gfx::IntPoint> fixed_point = {});
bool is_pinned() const { return m_pinned; }
void set_pinned(bool);
void set_vertically_maximized();
bool is_fullscreen() const { return m_fullscreen; }
@ -411,6 +415,7 @@ private:
bool m_invalidated_frame { true };
bool m_hit_testing_enabled { true };
bool m_modified { false };
bool m_pinned { false };
bool m_moving_to_another_stack { false };
bool m_invalidate_last_render_rects { false };
WindowTileType m_tiled { WindowTileType::None };
@ -439,6 +444,7 @@ private:
MenuItem* m_window_menu_maximize_item { nullptr };
MenuItem* m_window_menu_move_item { nullptr };
MenuItem* m_window_menu_close_item { nullptr };
MenuItem* m_window_menu_pin_item { nullptr };
MenuItem* m_window_menu_menubar_visibility_item { nullptr };
Optional<int> m_progress;
bool m_should_show_menubar { true };