1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 11:47:35 +00:00

WindowServer: Add an Overlay class for flicker-free overlay rendering

An Overlay is similar to a transparent window, but has less overhead
and does not get rendered within the window stack. Basically, the area
that an Overlay occupies forces transparency rendering for any window
underneath, which allows us to render them flicker-free.

This also adds a new API that allows displaying the screen numbers,
e.g. while the user configures the screen layout in DisplaySettings

Because other things like drag&drop or the window-size label are not
yet converted to use this new mechanism, they will be drawn over the
screen-number currently.
This commit is contained in:
Tom 2021-06-20 13:23:43 -06:00 committed by Andreas Kling
parent 42cb38b71a
commit 41859ad3fe
14 changed files with 638 additions and 7 deletions

View file

@ -68,6 +68,9 @@ ClientConnection::~ClientConnection()
if (window.value->type() == WindowType::Applet)
AppletManager::the().remove_applet(window.value);
}
if (m_show_screen_number)
Compositor::the().decrement_show_screen_number({});
}
void ClientConnection::die()
@ -316,6 +319,17 @@ Messages::WindowServer::SaveScreenLayoutResponse ClientConnection::save_screen_l
return { success, move(error_msg) };
}
void ClientConnection::show_screen_numbers(bool show)
{
if (m_show_screen_number == show)
return;
m_show_screen_number = show;
if (show)
Compositor::the().increment_show_screen_number({});
else
Compositor::the().decrement_show_screen_number({});
}
void ClientConnection::set_window_title(i32 window_id, String const& title)
{
auto it = m_windows.find(window_id);