summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZaggy1024 <zaggy1024@gmail.com>2023-04-12 01:59:26 -0500
committerSam Atkins <atkinssj@gmail.com>2023-04-14 12:05:52 +0100
commitd4c33a713474ea0020edf4b5e4d2091dd6d8b748 (patch)
tree97dd9df0771b31ff30c23b45fbcb21517b06a6f5
parente391f18e9e813443ba4c6aead2041a1c01b2227a (diff)
downloadserenity-d4c33a713474ea0020edf4b5e4d2091dd6d8b748.zip
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.
-rw-r--r--Userland/Libraries/LibGUI/AbstractSlider.cpp3
1 files changed, 1 insertions, 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();
}
}