From e1ee59ac9de055fe9d9733235b89f671d88fc8d6 Mon Sep 17 00:00:00 2001 From: Tom Date: Tue, 9 Feb 2021 13:12:59 -0700 Subject: 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. --- Userland/Services/WindowServer/WindowFrame.h | 7 +++++++ Userland/Services/WindowServer/WindowManager.cpp | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'Userland/Services') 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; } -- cgit v1.2.3