1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 14:35:07 +00:00

WindowServer+LibGUI: Force full window repaints after theme change

We were not repainting windows that were occluded at the time of the
theme changing. This patch adds a way to bypass occlusion testing when
invalidating window rects.

Fixes #1249.
This commit is contained in:
Andreas Kling 2020-02-19 16:45:06 +01:00
parent 8a2dc5d188
commit eaa680ab8e
7 changed files with 20 additions and 12 deletions

View file

@ -341,7 +341,14 @@ bool Window::is_visible() const
void Window::update()
{
update({ 0, 0, width(), height() });
auto rect = this->rect();
update({ 0, 0, rect.width(), rect.height() });
}
void Window::force_update()
{
auto rect = this->rect();
WindowServerConnection::the().post_message(Messages::WindowServer::InvalidateRect(m_window_id, { { 0, 0, rect.width(), rect.height() } }, true));
}
void Window::update(const Gfx::Rect& a_rect)
@ -366,7 +373,7 @@ void Window::update(const Gfx::Rect& a_rect)
Vector<Gfx::Rect> rects_to_send;
for (auto& r : rects)
rects_to_send.append(r);
WindowServerConnection::the().post_message(Messages::WindowServer::InvalidateRect(m_window_id, rects_to_send));
WindowServerConnection::the().post_message(Messages::WindowServer::InvalidateRect(m_window_id, rects_to_send, false));
});
}
m_pending_paint_event_rects.append(a_rect);
@ -626,7 +633,7 @@ void Window::schedule_relayout()
void Window::update_all_windows(Badge<WindowServerConnection>)
{
for (auto* window : *all_windows) {
window->update();
window->force_update();
}
}