mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 17:49:40 +00:00
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.
This commit is contained in:
parent
ace1b34798
commit
e1ee59ac9d
Notes:
sideshowbarker
2024-07-18 22:28:05 +09:00
Author: https://github.com/tomuta
Commit: e1ee59ac9d
Pull-request: https://github.com/SerenityOS/serenity/pull/5278
2 changed files with 9 additions and 2 deletions
|
@ -85,6 +85,13 @@ public:
|
||||||
m_dirty = true;
|
m_dirty = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void theme_changed()
|
||||||
|
{
|
||||||
|
m_dirty = m_shadow_dirty = true;
|
||||||
|
layout_buttons();
|
||||||
|
set_button_icons();
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void paint_simple_rect_shadow(Gfx::Painter&, const Gfx::IntRect&, const Gfx::Bitmap&) const;
|
void paint_simple_rect_shadow(Gfx::Painter&, const Gfx::IntRect&, const Gfx::Bitmap&) const;
|
||||||
void paint_notification_frame(Gfx::Painter&);
|
void paint_notification_frame(Gfx::Painter&);
|
||||||
|
|
|
@ -1432,14 +1432,14 @@ bool WindowManager::update_theme(String theme_path, String theme_name)
|
||||||
notified_clients.set(window.client());
|
notified_clients.set(window.client());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
window.frame().layout_buttons();
|
window.frame().theme_changed();
|
||||||
window.frame().set_button_icons();
|
|
||||||
return IterationDecision::Continue;
|
return IterationDecision::Continue;
|
||||||
});
|
});
|
||||||
MenuManager::the().did_change_theme();
|
MenuManager::the().did_change_theme();
|
||||||
auto wm_config = Core::ConfigFile::open("/etc/WindowServer/WindowServer.ini");
|
auto wm_config = Core::ConfigFile::open("/etc/WindowServer/WindowServer.ini");
|
||||||
wm_config->write_entry("Theme", "Name", theme_name);
|
wm_config->write_entry("Theme", "Name", theme_name);
|
||||||
wm_config->sync();
|
wm_config->sync();
|
||||||
|
Compositor::the().invalidate_occlusions();
|
||||||
Compositor::the().invalidate_screen();
|
Compositor::the().invalidate_screen();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue