Explorar o código

Ladybird/Qt: Use a precise timer for event loop timer events

This improves the accuracy of `setTimeout()`.
Tim Ledbetter hai 1 ano
pai
achega
a968bc6f80
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      Ladybird/Qt/EventLoopImplementationQt.cpp

+ 1 - 0
Ladybird/Qt/EventLoopImplementationQt.cpp

@@ -91,6 +91,7 @@ static void qt_timer_fired(Core::TimerShouldFireWhenNotVisible should_fire_when_
 intptr_t EventLoopManagerQt::register_timer(Core::EventReceiver& object, int milliseconds, bool should_reload, Core::TimerShouldFireWhenNotVisible should_fire_when_not_visible)
 {
     auto timer = new QTimer;
+    timer->setTimerType(Qt::PreciseTimer);
     timer->setInterval(milliseconds);
     timer->setSingleShot(!should_reload);
     auto weak_object = object.make_weak_ptr();