diff options
author | Tom <tomut@yahoo.com> | 2021-06-20 13:23:43 -0600 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-06-25 20:38:13 +0200 |
commit | 41859ad3feda56463ce0f73b898714ae17670ca6 (patch) | |
tree | 2592325a640c338620870c27fd16aee3174ef9ca /Userland/Services/WindowServer/WindowManager.cpp | |
parent | 42cb38b71a469c5b68280f9bc4b54a895781159d (diff) | |
download | serenity-41859ad3feda56463ce0f73b898714ae17670ca6.zip |
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.
Diffstat (limited to 'Userland/Services/WindowServer/WindowManager.cpp')
-rw-r--r-- | Userland/Services/WindowServer/WindowManager.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/Userland/Services/WindowServer/WindowManager.cpp b/Userland/Services/WindowServer/WindowManager.cpp index 1df6316a58..762899285c 100644 --- a/Userland/Services/WindowServer/WindowManager.cpp +++ b/Userland/Services/WindowServer/WindowManager.cpp @@ -85,6 +85,18 @@ void WindowManager::reload_config() reload_cursor(m_wait_cursor, "Wait"); reload_cursor(m_crosshair_cursor, "Crosshair"); + auto reload_graphic = [&](RefPtr<MultiScaleBitmaps>& bitmap, String const& name) { + if (bitmap) { + if (!bitmap->load(name)) + bitmap = nullptr; + } else { + bitmap = MultiScaleBitmaps::create(name); + } + }; + + reload_graphic(m_overlay_rect_shadow, m_config->read_entry("Graphics", "OverlayRectShadow")); + Compositor::the().invalidate_after_theme_or_font_change(); + WindowFrame::reload_config(); } @@ -1531,8 +1543,7 @@ void WindowManager::invalidate_after_theme_or_font_change() }); MenuManager::the().did_change_theme(); AppletManager::the().did_change_theme(); - Compositor::the().invalidate_occlusions(); - Compositor::the().invalidate_screen(); + Compositor::the().invalidate_after_theme_or_font_change(); } bool WindowManager::update_theme(String theme_path, String theme_name) |