From d4c33a713474ea0020edf4b5e4d2091dd6d8b748 Mon Sep 17 00:00:00 2001 From: Zaggy1024 Date: Wed, 12 Apr 2023 01:59:26 -0500 Subject: LibGUI: Only redraw sliders after the `on_change` callback has finished This prevents the seek slider in VideoPlayer from skipping forward and then back when fast seeking is enabled. Previously, it was possible for a single frame to render before the actual seek position in the seek bar was set. --- Userland/Libraries/LibGUI/AbstractSlider.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Userland/Libraries/LibGUI/AbstractSlider.cpp b/Userland/Libraries/LibGUI/AbstractSlider.cpp index 4f1442a0da..4a45a5c674 100644 --- a/Userland/Libraries/LibGUI/AbstractSlider.cpp +++ b/Userland/Libraries/LibGUI/AbstractSlider.cpp @@ -57,10 +57,9 @@ void AbstractSlider::set_value(int value, AllowCallback allow_callback, DoClamp if (m_value == value) return; m_value = value; - update(); - if (on_change && allow_callback == AllowCallback::Yes) on_change(m_value); + update(); } } -- cgit v1.2.3