1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 04:38:11 +00:00

LibCore+Userland: Don't auto-start new Core::Timers

This was unintuitive, and only useful in a few cases. In the majority,
users had to immediately call `stop()`, and several who did want the
timer started would call `start()` on it immediately anyway. Case in
point: There are only two places I had to add a manual `start()`.
This commit is contained in:
Sam Atkins 2023-01-11 19:36:46 +00:00 committed by Andreas Kling
parent a8cf0c9371
commit 6edc0cf5ab
10 changed files with 12 additions and 8 deletions

View file

@ -82,8 +82,10 @@ ThreadStackWidget::ThreadStackWidget()
void ThreadStackWidget::show_event(GUI::ShowEvent&)
{
refresh();
if (!m_timer)
if (!m_timer) {
m_timer = add<Core::Timer>(1000, [this] { refresh(); });
m_timer->start();
}
}
void ThreadStackWidget::hide_event(GUI::HideEvent&)