Skip to content

Workaround cursor visible after button click, #4183 #4191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 25, 2023
Merged

Conversation

low-batt
Copy link
Contributor

This commit will:

  • Add a new method workaroundCursorDefect to MainWindowController that will hide the cursor again if the OSC is hidden
  • Change mouseDown and mouseUp to call workaroundCursorDefect
  • Add methods otherMouseDown, otherMouseUp, rightMouseDown and rightMouseUp to MainWindowController that apply the workaround
  • Add method rightMouseDown to VideoView to pass that mouse event to MainWindowController

These changes workaround a regression in the macOS AppKit method NSCursor.setHiddenUntilMouseMoves introduced in macOS Big Sur that causes the cursor to become visible when a mouse button is clicked even if the mouse does not move.

This problem has been reported to Apple.


Description:
This is a workaround for a macOS AppKit defect.

@uiryuu
Copy link
Member

uiryuu commented Mar 22, 2023

I think it is possible that Apple intentionally did that. So what if we show the UI as well when pausing and resuming even if the cursor doesn't move?

@low-batt
Copy link
Contributor Author

I would find the behavior of bringing up the OSC even though the mouse did not move irritating and would ask for a preference to disable it. Some of the time I intentionally keep the mouse still and pause and resume using the mouse buttons. I did not notice this defect since the Mac's I do that on are still running Catalina (which does not have this problem) as I wait for Apple to fix some of the many regressions added in Big Sur. Without adding new ones.

I too was worried that Apple intentionally made this horrendous change breaking backward compatibility, turning the name of the API into a lie and then on top of that did not update the documentation to reflect this new unexpected behavior, all for something an application can easily accomplish if they want to while processing the button click. I concluded Apple can not have possibly intentionally made such a change and it must be an accidental regression.

As of today Apple has not responded to the feedback I submitted reporting this regression. My guess is that during triage they looked at the title of my feedback and thought "that can't possibly be broken, must be a user error" and inserted my defect report deep into the massive backlog.

@low-batt
Copy link
Contributor Author

I continued to think about this today. I'm now even more convinced that the correct solution is to restore the IINA behavior seen in Catalina before Apple changed AppKit. To get to the OSC all the user has to do is to move the mouse. But that is not what they are doing. They are intentionally clicking somewhere in the window instead of moving the mouse.

They are doing this to invoke whatever action they have configured IINA to perform in reaction to a mouse button click. That can be configured in the IINA settings Control tab.

In my case I have the Single click to setting configured to Hide OSC. Showing the OSC would definitely not be the correct reaction. If we thought showing the OSC was a good idea in reaction to a button click we could enhance this section of settings to provide such an option.

The user does receive feedback if they have the button click configured to Pause / Resume as IINA will display an OSD message (unless you disabled to OSD).

This commit will:
- Add a new method workaroundCursorDefect to MainWindowController
  that will hide the cursor again if the OSC is hidden
- Change mouseDown and mouseUp to call workaroundCursorDefect
- Add methods otherMouseDown, otherMouseUp, rightMouseDown and
  rightMouseUp to MainWindowController that apply the workaround
- Add method rightMouseDown to VideoView to pass that mouse event
  to MainWindowController

These changes workaround a regression in the macOS AppKit method
NSCursor.setHiddenUntilMouseMoves introduced in macOS Big Sur that
causes the cursor to become visible when a mouse button is clicked
even if the mouse does not move.

This problem has been reported to Apple.
@uiryuu uiryuu merged commit bea84bb into develop Apr 25, 2023
@uiryuu uiryuu deleted the fix-4183 branch April 25, 2023 01:50
@uiryuu uiryuu restored the fix-4183 branch April 25, 2023 02:01
@uiryuu uiryuu deleted the fix-4183 branch April 25, 2023 02:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cursor remains visible after resuming playback with the touchpad using secondary click
2 participants