From 97e18a6ce197e6928e079416a301d38a4b4539a8 Mon Sep 17 00:00:00 2001 From: Tom Date: Mon, 21 Feb 2022 19:26:31 -0700 Subject: [PATCH] WindowServer: Mark window frame as invalidated when updating title We need to set Window::m_invalidated_frame to true when invalidating the title, otherwise we may miss re-rendering the frame if nothing else triggers it. --- Userland/Services/WindowServer/Window.cpp | 10 +++++----- Userland/Services/WindowServer/Window.h | 4 ++-- Userland/Services/WindowServer/WindowFrame.cpp | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Userland/Services/WindowServer/Window.cpp b/Userland/Services/WindowServer/Window.cpp index daae361091..7b44e5e9b1 100644 --- a/Userland/Services/WindowServer/Window.cpp +++ b/Userland/Services/WindowServer/Window.cpp @@ -650,23 +650,23 @@ void Window::invalidate(bool invalidate_frame, bool re_render_frame) Compositor::the().invalidate_window(); } -void Window::invalidate(Gfx::IntRect const& rect) +void Window::invalidate(Gfx::IntRect const& rect, bool invalidate_frame) { if (type() == WindowType::Applet) { AppletManager::the().invalidate_applet(*this, rect); return; } - if (invalidate_no_notify(rect)) + if (invalidate_no_notify(rect, invalidate_frame)) Compositor::the().invalidate_window(); } -bool Window::invalidate_no_notify(const Gfx::IntRect& rect, bool with_frame) +bool Window::invalidate_no_notify(const Gfx::IntRect& rect, bool invalidate_frame) { if (rect.is_empty()) return false; if (m_invalidated_all) { - if (with_frame) + if (invalidate_frame) m_invalidated_frame |= true; return false; } @@ -680,7 +680,7 @@ bool Window::invalidate_no_notify(const Gfx::IntRect& rect, bool with_frame) return false; m_invalidated = true; - if (with_frame) + if (invalidate_frame) m_invalidated_frame |= true; m_dirty_rects.add(inner_rect.translated(-outer_rect.location())); return true; diff --git a/Userland/Services/WindowServer/Window.h b/Userland/Services/WindowServer/Window.h index 253c77f90d..eb5de5692c 100644 --- a/Userland/Services/WindowServer/Window.h +++ b/Userland/Services/WindowServer/Window.h @@ -211,9 +211,9 @@ public: Gfx::IntSize size() const { return m_rect.size(); } void invalidate(bool with_frame = true, bool re_render_frame = false); - void invalidate(Gfx::IntRect const&); + void invalidate(Gfx::IntRect const&, bool invalidate_frame = false); void invalidate_menubar(); - bool invalidate_no_notify(const Gfx::IntRect& rect, bool with_frame = false); + bool invalidate_no_notify(const Gfx::IntRect& rect, bool invalidate_frame = false); void invalidate_last_rendered_screen_rects(); void invalidate_last_rendered_screen_rects_now(); [[nodiscard]] bool should_invalidate_last_rendered_screen_rects() { return exchange(m_invalidate_last_render_rects, false); } diff --git a/Userland/Services/WindowServer/WindowFrame.cpp b/Userland/Services/WindowServer/WindowFrame.cpp index 5710d7f856..b3c3363949 100644 --- a/Userland/Services/WindowServer/WindowFrame.cpp +++ b/Userland/Services/WindowServer/WindowFrame.cpp @@ -624,7 +624,7 @@ void WindowFrame::invalidate(Gfx::IntRect relative_rect) auto window_rect = m_window.rect(); relative_rect.translate_by(frame_rect.x() - window_rect.x(), frame_rect.y() - window_rect.y()); set_dirty(); - m_window.invalidate(relative_rect); + m_window.invalidate(relative_rect, true); } void WindowFrame::window_rect_changed(const Gfx::IntRect& old_rect, const Gfx::IntRect& new_rect)