mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:47:45 +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)
|
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();
|
clear_bitmaps();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,6 +99,10 @@ void RectangularOverlay::clear_bitmaps()
|
||||||
|
|
||||||
void RectangularOverlay::render(Gfx::Painter& painter, Screen const& screen)
|
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 scale_factor = screen.scale_factor();
|
||||||
auto* bitmap = m_rendered_bitmaps->find_bitmap(scale_factor);
|
auto* bitmap = m_rendered_bitmaps->find_bitmap(scale_factor);
|
||||||
if (!bitmap) {
|
if (!bitmap) {
|
||||||
|
@ -136,6 +140,12 @@ void RectangularOverlay::set_content_rect(Gfx::IntRect const& rect)
|
||||||
set_rect(calculate_frame_rect(rect));
|
set_rect(calculate_frame_rect(rect));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RectangularOverlay::invalidate_content()
|
||||||
|
{
|
||||||
|
m_content_invalidated = true;
|
||||||
|
invalidate();
|
||||||
|
}
|
||||||
|
|
||||||
Gfx::Font const* ScreenNumberOverlay::s_font { nullptr };
|
Gfx::Font const* ScreenNumberOverlay::s_font { nullptr };
|
||||||
|
|
||||||
ScreenNumberOverlay::ScreenNumberOverlay(Screen& screen)
|
ScreenNumberOverlay::ScreenNumberOverlay(Screen& screen)
|
||||||
|
@ -211,7 +221,6 @@ Gfx::IntRect ScreenNumberOverlay::calculate_content_rect_for_screen(Screen& scre
|
||||||
WindowGeometryOverlay::WindowGeometryOverlay(Window& window)
|
WindowGeometryOverlay::WindowGeometryOverlay(Window& window)
|
||||||
: m_window(window)
|
: m_window(window)
|
||||||
{
|
{
|
||||||
rerender_on_location_change(true);
|
|
||||||
update_rect();
|
update_rect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -254,7 +263,7 @@ void WindowGeometryOverlay::render_overlay_bitmap(Gfx::Painter& painter)
|
||||||
void WindowGeometryOverlay::window_rect_changed()
|
void WindowGeometryOverlay::window_rect_changed()
|
||||||
{
|
{
|
||||||
update_rect();
|
update_rect();
|
||||||
invalidate();
|
invalidate_content();
|
||||||
}
|
}
|
||||||
|
|
||||||
DndOverlay::DndOverlay(String const& text, Gfx::Bitmap const* bitmap)
|
DndOverlay::DndOverlay(String const& text, Gfx::Bitmap const* bitmap)
|
||||||
|
|
|
@ -100,14 +100,11 @@ protected:
|
||||||
void clear_bitmaps();
|
void clear_bitmaps();
|
||||||
virtual void rect_changed(Gfx::IntRect const&) override;
|
virtual void rect_changed(Gfx::IntRect const&) override;
|
||||||
|
|
||||||
void rerender_on_location_change(bool value)
|
void invalidate_content();
|
||||||
{
|
|
||||||
m_rerender_on_location_change = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
RefPtr<MultiScaleBitmaps> m_rendered_bitmaps;
|
RefPtr<MultiScaleBitmaps> m_rendered_bitmaps;
|
||||||
bool m_rerender_on_location_change { false };
|
bool m_content_invalidated { false };
|
||||||
};
|
};
|
||||||
|
|
||||||
class ScreenNumberOverlay : public RectangularOverlay {
|
class ScreenNumberOverlay : public RectangularOverlay {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue