Skip to content

Commit

Permalink
WindowServer: Mark window frame as invalidated when updating title
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tomuta authored and bgianfo committed Feb 22, 2022
1 parent 678d26d commit 97e18a6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions Userland/Services/WindowServer/Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions Userland/Services/WindowServer/Window.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,9 @@ class Window final : public Core::Object {
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); }
Expand Down
2 changes: 1 addition & 1 deletion Userland/Services/WindowServer/WindowFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 97e18a6

Please sign in to comment.