13
0

Micro optimization: only queue resize when widget is realized

This commit is contained in:
Robin Gareus 2024-11-03 02:49:06 +01:00
parent d6e3afd3ae
commit 1b13bf607f
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 13 additions and 4 deletions

View File

@ -2387,8 +2387,11 @@ AudioClock::dpi_reset ()
*/ */
first_width = 0; first_width = 0;
first_height = 0; first_height = 0;
if (get_realized ()) {
queue_resize (); queue_resize ();
} }
}
void void
AudioClock::set_negative_allowed (bool yn) AudioClock::set_negative_allowed (bool yn)

View File

@ -116,8 +116,10 @@ DurationInfoBox::dpi_reset ()
_layout_value->get_pixel_size (wv, hv); _layout_value->get_pixel_size (wv, hv);
_width = 8 + wv; _width = 8 + wv;
_height = 4 + hv; _height = 4 + hv;
if (get_realized ()) {
queue_resize (); queue_resize ();
} }
}
void void
DurationInfoBox::render (Cairo::RefPtr<Cairo::Context> const& cr, cairo_rectangle_t* r) DurationInfoBox::render (Cairo::RefPtr<Cairo::Context> const& cr, cairo_rectangle_t* r)
@ -198,8 +200,10 @@ XrunInfoBox::dpi_reset ()
_layout_value->get_pixel_size (wv, hv); _layout_value->get_pixel_size (wv, hv);
_width = 8 + wv; _width = 8 + wv;
_height = 8 + hv; _height = 8 + hv;
if (get_realized ()) {
queue_resize (); queue_resize ();
} }
}
void void
XrunInfoBox::render (Cairo::RefPtr<Cairo::Context> const& cr, cairo_rectangle_t* r) XrunInfoBox::render (Cairo::RefPtr<Cairo::Context> const& cr, cairo_rectangle_t* r)
@ -291,8 +295,10 @@ RemainInfoBox::dpi_reset ()
_width = 8 + std::max (wl, wv); _width = 8 + std::max (wl, wv);
_height = 2 + hv + 2 + hl + 2; _height = 2 + hv + 2 + hl + 2;
if (get_realized ()) {
queue_resize (); queue_resize ();
} }
}
void void
RemainInfoBox::count_recenabled_streams (Route& route) RemainInfoBox::count_recenabled_streams (Route& route)