1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:07:45 +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

@ -2005,6 +2005,14 @@ void WindowManager::maximize_windows(Window& window, bool maximized)
});
}
void WindowManager::set_pinned(Window& window, bool pinned)
{
for_each_window_in_modal_stack(window, [&](auto& w, bool) {
w.set_pinned(pinned);
return IterationDecision::Continue;
});
}
Gfx::IntPoint WindowManager::get_recommended_window_position(Gfx::IntPoint const& desired)
{
// FIXME: Find a better source for the width and height to shift by.