Skip to content

Commit 59301db

Browse files
authored
Fix OSC button for increasing speed does not work, #5768 (#5769)
This commit will add a mouseDown function to the PlaySlider and TimeLabelOverflowedStackView classes that merely calls the parent class's method. This is a workaround for an AppKit problem in macOS Tahoe related to mouse events. We do not know why this workaround works. See the issue for more discussion.
1 parent 24214d2 commit 59301db

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

iina/PlaySlider.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,17 @@ final class PlaySlider: NSSlider {
9595

9696
// MARK: - Mouse / Trackpad events
9797

98+
/// Informs the receiver that the user has pressed the left mouse button.
99+
///
100+
/// This is a workaround for IINA issue #5768 where starting with macOS Tahoe AppKit is miss-handling mouse events in certain
101+
/// circumstances. Merely adding this function solved the problem. Maybe the presence of this function prevents the use of some sort
102+
/// of faulty optimization?
103+
/// - Important: _DO NOT REMOVE_ this function thinking it is not needed. Read issue #5768.
104+
/// - Parameter event: An object encapsulating information about the mouse-down event.
105+
override func mouseDown(with event: NSEvent) {
106+
super.mouseDown(with: event)
107+
}
108+
98109
/// The user is scrolling while the cursor is within the slider.
99110
///
100111
/// With certain kinds of input devices, such as a mouse with a scroll wheel that spins freely, it is easy to accidentally move the cursor

iina/TimeLabelOverflowedStackView.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,14 @@ class TimeLabelOverflowedStackView: NSStackView {
1414
return NSEdgeInsets(top: 6, left: 0, bottom: 0, right: 0)
1515
}
1616

17+
/// Informs the receiver that the user has pressed the left mouse button.
18+
///
19+
/// This is a workaround for IINA issue #5768 where starting with macOS Tahoe AppKit is miss-handling mouse events in certain
20+
/// circumstances. Merely adding this function solved the problem. Maybe the presence of this function prevents the use of some sort
21+
/// of faulty optimization?
22+
/// - Important: _DO NOT REMOVE_ this function thinking it is not needed. Read issue #5768.
23+
/// - Parameter event: An object encapsulating information about the mouse-down event.
24+
override func mouseDown(with event: NSEvent) {
25+
super.mouseDown(with: event)
26+
}
1727
}

0 commit comments

Comments
 (0)