mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 04:57:44 +00:00
WindowServer: Fix geometry label not updating if it isn't moving
This fixes a regression where the geometry label isn't updating even though the window geometry had changed because the geometry label's location isn't changing.
This commit is contained in:
parent
f61a9f2dc5
commit
c12cbb96ce
2 changed files with 14 additions and 8 deletions
|
@ -88,7 +88,7 @@ RectangularOverlay::RectangularOverlay()
|
|||
|
||||
void RectangularOverlay::rect_changed(Gfx::IntRect const& previous_rect)
|
||||
{
|
||||
if (m_rerender_on_location_change || rect().size() != previous_rect.size())
|
||||
if (rect().size() != previous_rect.size())
|
||||
clear_bitmaps();
|
||||
}
|
||||
|
||||
|
@ -99,6 +99,10 @@ void RectangularOverlay::clear_bitmaps()
|
|||
|
||||
void RectangularOverlay::render(Gfx::Painter& painter, Screen const& screen)
|
||||
{
|
||||
if (m_content_invalidated) {
|
||||
clear_bitmaps();
|
||||
m_content_invalidated = false;
|
||||
}
|
||||
auto scale_factor = screen.scale_factor();
|
||||
auto* bitmap = m_rendered_bitmaps->find_bitmap(scale_factor);
|
||||
if (!bitmap) {
|
||||
|
@ -136,6 +140,12 @@ void RectangularOverlay::set_content_rect(Gfx::IntRect const& rect)
|
|||
set_rect(calculate_frame_rect(rect));
|
||||
}
|
||||
|
||||
void RectangularOverlay::invalidate_content()
|
||||
{
|
||||
m_content_invalidated = true;
|
||||
invalidate();
|
||||
}
|
||||
|
||||
Gfx::Font const* ScreenNumberOverlay::s_font { nullptr };
|
||||
|
||||
ScreenNumberOverlay::ScreenNumberOverlay(Screen& screen)
|
||||
|
@ -211,7 +221,6 @@ Gfx::IntRect ScreenNumberOverlay::calculate_content_rect_for_screen(Screen& scre
|
|||
WindowGeometryOverlay::WindowGeometryOverlay(Window& window)
|
||||
: m_window(window)
|
||||
{
|
||||
rerender_on_location_change(true);
|
||||
update_rect();
|
||||
}
|
||||
|
||||
|
@ -254,7 +263,7 @@ void WindowGeometryOverlay::render_overlay_bitmap(Gfx::Painter& painter)
|
|||
void WindowGeometryOverlay::window_rect_changed()
|
||||
{
|
||||
update_rect();
|
||||
invalidate();
|
||||
invalidate_content();
|
||||
}
|
||||
|
||||
DndOverlay::DndOverlay(String const& text, Gfx::Bitmap const* bitmap)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue