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
Drag detection in main window is way too sensitive, causing some taps to be "ignored" #4231
Comments
On whether IINA users are experiencing this issue. I believe this is the cause of issue #3198. The behavior reported in the last comment in issue ##3136 could also be due to this issue. So yes. And I believe I have encountered this. When there is a flat surface nearby I use a high end Logitech mouse. I prefer the lack of the rubber band effect when scrolling. Less often I will use the touchpad. I can remember quickly tapping and being surprised the side panel did not close. As it closed when I tried again I assumed the tap had not registered. I'm now thinking it was this issue. However as the nice debug logging shows AppKit has interpreted the mouse actions as dragging, this seems like a general macOS issue and not an IINA issue. Searching the net I found it hard to locate posts regarding this issue, but I did find a few posts complaining about the behavior of macOS. So up first is to confirm macOS does not provide any settings to address this. I believe the relevant Apple documentation is Change Pointer Control settings for accessibility on Mac. The I'm surprised this is not addressed by a macOS Next is to check to see what Apple's Human Interface Guidelines has to say about this. In the Pointing devices section under
Reading that section my interpretation is that the primary concern is about not changing the high level behavior of a standard gesture. The HIG does not get into a lower level issue like the one at hand. But the "work the same" statement could be interpreted as covering not altering how dragging works. Is there is any precedence for this in IINA? In Is it a common application practice to establish its own threshold for the mouse to move before accepting the operating system's dragging interpretation? I found nothing in Apple's documentation and examples. I was also unable to find any macOS examples on the net. I found the Stack Overflow JavaScript post How to distinguish mouse "click" and "drag" from 10 years ago to which there are some replies indicating the need to "require a minimum delta" before interpreting a mouse movement as a drag. I bounced this off another developer (not an IINA contributor). He had a very strong opinion that if a macOS application were to establish its own delta then it must provide a setting for the user to opt into this. By default the application must accept the interpretation of macOS. Given all that, here are my thoughts…
Don't pay too much attention to my thoughts. I'm not a GUI programmer. Need to hear the opinions of experienced macOS GUI programmers. |
After some more research and testing, couple of big points:
So, highly doubt the user will notice the effect on drag. I really don't think this is worth the effort of creating a new user setting for. In fact, it seems like my 2 pts distance threshold is smaller than average - I might suggest increasing it to 5. Of the answers I found online, two gave 5, one gave 6, though I found one that did suggest 2. Just playing with several random apps (Finder icons, Chrome tabs, GMail messages...) - feels like 4-5 is pretty typical. Although almost all of them seem to jump when they hit the threshold... I'm not opposed to changing the code to add in the jump, though I am a bit fond of the smoothness of this solution, tbh ;)
I think I'm beginning to understand a bit better why Apple might have left it out. Had there been one, users might have assumed that it should apply to all applications. I found this discussion which goes into some examples of how there isn't really a one-size-fits-all approach.
Try disabling On that same screen, I suppose the incredibly misleading checkbox |
That Stack Exchange post is really interesting. Good points about the proposed change being isolated and not needing to be controllable by the user. I have to defer to the other IINA developers on this as my background is not in UIs. You will find posts on the net recommending disabling Similar deal with the |
I've always found it more difficult to argue why some frontend decision is better than others. Maybe because it's so wrapped up in aesthetics, and the fact that what is more usable is frequently not the same is what is more logical. And to some, it is just intuitive, while to others, not at all obvious. Often it seems to come down to the project owners and trusting that they make the right choices... I pushed an update to the PR which increased the drag threshold to 4.0 points. I found at 2pts, when I made really sloppy clicks it would still register as a drag, and seems like at 4.0 it still doesn't hinder legitimate drags. |
This is fixed in the released version of IINA. |
System and IINA version:
I've been frustrated by this issue for quite a while now, and although I couldn't find anything via a quick search, I'm pretty sure I've come across at least a couple user reports that noted there was "no way to close the side panel" or that clicking to close didn't work reliably. I finally committed a big chunk of time to tracking it down, and I think I've found the culprit.
To get a better view of how clicks were being registered, I placed these logging statements at the start of these methods in
MainWindowController
:When I ran IINA with my test logging, I saw messages in the log like these:
This declared my tap was a "drag" (and thus not a click) even though my click lasted for 127ms and the drag distance was only 0.1pt in screen coordinates!
I should point out that I'm using the trackpad on a 16" MacBook Pro M1 Pro. Unlike most developers, I never use a mouse. (It's one of the main reasons I use Macs instead of other operating systems: multi-touch on on Linux/Windows has been almost unusable). And I happen to wear a glove size XL - I've got large hands and fingers. So I can see how this problem may not be noticeable for a mouse user, or someone who has smaller fingers. But for me, Apple's trackpad is so sensitive that it will send a "drag" notification even if my finger does a tiny rolling motion during a tap, or if my motion isn't straight down and up again. This is an unreasonable amount of precision to expect, and it doesn't align with other apps' behavior.
Expected behavior:
If the user does what a reasonable person considers to be a "tap", IINA should respond to it as a tap. It should only think the user is dragging once they drag some very small minimum distance, or hold it down longer than some reasonable time threshold, or both.
Actual behavior:
Sometimes users' taps or clicks are basically ignored because IINA incorrectly concluded that they wanted to quickly move the window by a single pixel or less.
Steps to reproduce:
See above.
How often does this happen?
When trying to close a side panel by tapping the video, there's about a 50-75% chance that my first tap will fail and a second attempt is needed. Probably the frequency varies widely between different users based on their usage patterns, and maybe trackpad users are more affected than mouse users.
The text was updated successfully, but these errors were encountered: