Skip to content
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

Invalidate mouse position when releasing final touch #6458

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

frenzibyte
Copy link
Member

@frenzibyte frenzibyte commented Dec 15, 2024

This fixes an issue in mobile where if a user pressed a specific button in the game, the button will remain in a hovered state because that's where the mouse position was last at. Using the feedback of touch end event, we can put the mouse position in an "invalid" state such that any hovered drawable becomes unhovered, giving a more natural UX for mobile users.

For emphasizing purposes, the following are "broken" with this change:

  • Tooltips, as they rely primarily on hover
  • ExpandingContainer usages (fixable)

Whether they are considered blockers for this PR or not is up for debate, so I'm keeping this PR open. The fixable parts will be fixed if this PR is agreed upon first (i.e. if tooltips do not block this).

Before:

ScreenRecording_12-15-2024.10-54-52_1.mov

After:

ScreenRecording_12-15-2024.10-57-34_1.mov

(notice the buttons don't stay hovered after tapping them)

@frenzibyte frenzibyte force-pushed the touch-end-invalidates-mouse branch from 50ff4d9 to 515ffbf Compare December 15, 2024 16:31
@frenzibyte frenzibyte self-assigned this Dec 15, 2024
@Susko3
Copy link
Member

Susko3 commented Dec 15, 2024

If this were to go in, MouseHandler.absolutePositionReceived needs to be updated.

Actually, I would consider this bug a feature. Hovering is used extensively throughout the UI of osu!, this bug is the only thing that makes it usable on mobile.

For example, when browsing the beatmap listing, I can "hover" a card and press the download button, way faster then going to the full beatmap page and downloading it there, especially if I want to download multiple beatmaps. The UX is bad because I have to do a short scroll, but it works /shrug

2024-12-15.23-03-54.mp4

@frenzibyte
Copy link
Member Author

If this were to go in, MouseHandler.absolutePositionReceived needs to be updated.

I'm not sure how much it makes sense seeing that the property is only updated once to true and never reset again, but sure.

Actually, I would consider this bug a feature. Hovering is used extensively throughout the UI of osu!, this bug is the only thing that makes it usable on mobile.

From the basic concept of hovering, there should be a pointer on the screen pointing at said drawable to be in a hovered state. Whether that's a cursor, or a pen on a tablet (i.e. Apple Pencil). Hovering does not make sense on touchscreens in any way, shape, or form. This is awkward UI/UX, not a feature.

For example, when browsing the beatmap listing, I can "hover" a card and press the download button, way faster then going to the full beatmap page and downloading it there, especially if I want to download multiple beatmaps. The UX is bad because I have to do a short scroll, but it works /shrug

This is not valid UX, you don't touch the screen once and then the component changes it state, especially with its context being that of a ghost pointer hovering it. Downloading beatmaps from the beatmap listing in mobile devices is not in a good state generally, hovering should not be a requirement to press the download button, this should be reassessed. See ppy/osu#31151.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants