summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-02-19 16:45:06 +0100
committerAndreas Kling <kling@serenityos.org>2020-02-19 16:46:28 +0100
commiteaa680ab8e7ca227f959eff167a1dd23c433e909 (patch)
tree5d599ef42026288c64b3bc4f06d60d0cde98fa5f /Libraries
parent8a2dc5d188fb9ff456854103a4051352fda3107b (diff)
downloadserenity-eaa680ab8e7ca227f959eff167a1dd23c433e909.zip
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.
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibGUI/Window.cpp13
-rw-r--r--Libraries/LibGUI/Window.h1
2 files changed, 11 insertions, 3 deletions
diff --git a/Libraries/LibGUI/Window.cpp b/Libraries/LibGUI/Window.cpp
index 3386f9a86c..d4a60148d0 100644
--- a/Libraries/LibGUI/Window.cpp
+++ b/Libraries/LibGUI/Window.cpp
@@ -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();
}
}
diff --git a/Libraries/LibGUI/Window.h b/Libraries/LibGUI/Window.h
index 7c2478242d..33f7e1d689 100644
--- a/Libraries/LibGUI/Window.h
+++ b/Libraries/LibGUI/Window.h
@@ -182,6 +182,7 @@ private:
NonnullRefPtr<Gfx::Bitmap> create_shared_bitmap(Gfx::BitmapFormat, const Gfx::Size&);
void set_current_backing_bitmap(Gfx::Bitmap&, bool flush_immediately = false);
void flip(const Vector<Gfx::Rect, 32>& dirty_rects);
+ void force_update();
RefPtr<Gfx::Bitmap> m_front_bitmap;
RefPtr<Gfx::Bitmap> m_back_bitmap;