Commit 1fe7c233 authored by Marvin Scholz's avatar Marvin Scholz

macOS: Avoid double-seeking to the same position

The sliders for seeking are continuous, that means they send events
for every action, which is useful to seek when the slider is dragged.
But when the slider is clicked, this results in two seeks nearly at the
same time to the same position.
Therefore this commit introduces a check that ignores the slider update
if it originated from a NSLeftMouseUp event to workaround that.

Ref. #17954
parent f117fee0
......@@ -291,6 +291,14 @@
switch([[NSApp currentEvent] type]) {
case NSLeftMouseUp:
/* Ignore mouse up, as this is a continous slider and
* when the user does a single click to a position on the slider,
* the action is called twice, once for the mouse down and once
* for the mouse up event. This results in two short seeks one
* after another to the same position, which results in weird
* audio quirks.
*/
return;
case NSLeftMouseDown:
case NSLeftMouseDragged:
f_updated = [sender floatValue];
......
......@@ -173,6 +173,23 @@
- (IBAction)timeSliderUpdate:(id)sender
{
switch([[NSApp currentEvent] type]) {
case NSLeftMouseUp:
/* Ignore mouse up, as this is a continous slider and
* when the user does a single click to a position on the slider,
* the action is called twice, once for the mouse down and once
* for the mouse up event. This results in two short seeks one
* after another to the same position, which results in weird
* audio quirks.
*/
return;
case NSLeftMouseDown:
case NSLeftMouseDragged:
break;
default:
return;
}
input_thread_t *p_input;
p_input = pl_CurrentInput(getIntf());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment