Skip to content

Fix tooltip position abruptly changing when content reaches edge of the screen#6622

Open
Joehuu wants to merge 2 commits into
ppy:masterfrom
Joehuu:fix-tooltip-positioning
Open

Fix tooltip position abruptly changing when content reaches edge of the screen#6622
Joehuu wants to merge 2 commits into
ppy:masterfrom
Joehuu:fix-tooltip-positioning

Conversation

@Joehuu

@Joehuu Joehuu commented Aug 11, 2025

Copy link
Copy Markdown
Member

Just matches the x position logic. As indicated by the second issue, the previous logic didn't work to keep the tooltip content on screen when it gets moved to the top right of the cursor.

And as said in ppy/osu#34515, this will match stable FWIW.

Before After
Kapture 2025-08-10 at 18 43 06 Kapture 2025-08-10 at 18 33 41
Kapture 2025-08-10 at 18 44 47 Kapture 2025-08-10 at 18 38 38

@bdach

bdach commented Aug 11, 2025

Copy link
Copy Markdown
Collaborator

I don't know that I agree with this. This makes it possible for the cursor to occlude the tooltip when the tooltip is clamped to the window. Especially visible on elements with tooltips on the bottom right corner of the window.

Before:

Screen.Recording.2025-08-11.at.10.08.58.mov

After:

Screen.Recording.2025-08-11.at.10.09.25.mov

Will leave to @peppy to assess.

@smoogipoo

Copy link
Copy Markdown
Contributor

Maybe the path of least resistance is a bool AllowCursorOverlap => false property on ITooltip so it can be special-cased? Personally I feel like this is always going to be wanted behaviour for IHasCustomTooltip and not for IHasTooltip, but not sure if that stands true in practice.

@Joehuu Joehuu self-assigned this Aug 12, 2025
@peppy

peppy commented Aug 12, 2025

Copy link
Copy Markdown
Member

If exposing as a property works for the usages we're trying to fix then I see this as the best solution.

For me, the case we want to consider is touch input. We don't want tooltips to overlap a user's finger to the point they can't read it. But in the linked cases, the tooltips are huge and this is less of a problem. I'd argue that if-tooltip-is-larger-than-finger, overlapping is fine.

@Joehuu

Joehuu commented Aug 15, 2025

Copy link
Copy Markdown
Member Author

Here's the osu!-side branch (when I'm not here after this is merged): ppy/osu@master...Joehuu:osu:tooltip-allow-cursor-overlap

The current true cases are these (ones pointed out in the issues):
Screenshot 2025-08-15 at 4 32 07 PM

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.

Tooltips suddenly jump when nearing past screen boundaries and the content is too tall

4 participants