diff options
author | Tom <tomut@yahoo.com> | 2021-02-09 13:12:59 -0700 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-02-09 21:33:54 +0100 |
commit | e1ee59ac9de055fe9d9733235b89f671d88fc8d6 (patch) | |
tree | ddb72822b2ed7e691867164927f3c861aec17eb3 /Userland/Services | |
parent | ace1b347983f119433bb6fdcf49579648dbce8d2 (diff) | |
download | serenity-e1ee59ac9de055fe9d9733235b89f671d88fc8d6.zip |
WindowServer: Recompute occlusions and re-render shadows on theme change
Since theme changes may change geometrics, which are also affected by
window shadows, we need to recompute occlusions as well as re-render
window frames.
Diffstat (limited to 'Userland/Services')
-rw-r--r-- | Userland/Services/WindowServer/WindowFrame.h | 7 | ||||
-rw-r--r-- | Userland/Services/WindowServer/WindowManager.cpp | 4 |
2 files changed, 9 insertions, 2 deletions
diff --git a/Userland/Services/WindowServer/WindowFrame.h b/Userland/Services/WindowServer/WindowFrame.h index 536b26cbe7..28c38f04d2 100644 --- a/Userland/Services/WindowServer/WindowFrame.h +++ b/Userland/Services/WindowServer/WindowFrame.h @@ -85,6 +85,13 @@ public: m_dirty = true; } + void theme_changed() + { + m_dirty = m_shadow_dirty = true; + layout_buttons(); + set_button_icons(); + } + private: void paint_simple_rect_shadow(Gfx::Painter&, const Gfx::IntRect&, const Gfx::Bitmap&) const; void paint_notification_frame(Gfx::Painter&); diff --git a/Userland/Services/WindowServer/WindowManager.cpp b/Userland/Services/WindowServer/WindowManager.cpp index 9736908298..602b3e8e3b 100644 --- a/Userland/Services/WindowServer/WindowManager.cpp +++ b/Userland/Services/WindowServer/WindowManager.cpp @@ -1432,14 +1432,14 @@ bool WindowManager::update_theme(String theme_path, String theme_name) notified_clients.set(window.client()); } } - window.frame().layout_buttons(); - window.frame().set_button_icons(); + window.frame().theme_changed(); return IterationDecision::Continue; }); MenuManager::the().did_change_theme(); auto wm_config = Core::ConfigFile::open("/etc/WindowServer/WindowServer.ini"); wm_config->write_entry("Theme", "Name", theme_name); wm_config->sync(); + Compositor::the().invalidate_occlusions(); Compositor::the().invalidate_screen(); return true; } |