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

Tooltip persists after sudden focus change #14

Closed
Felix14-v2 opened this issue Jun 28, 2021 · 9 comments
Closed

Tooltip persists after sudden focus change #14

Felix14-v2 opened this issue Jun 28, 2021 · 9 comments
Labels
bug Something isn't working

Comments

@Felix14-v2
Copy link
Contributor

It is funny, but it is a bug :)
Demo
(I used a laptop touchpad to get this)

my rules – rules.zip

@EZForever
Copy link
Owner

This bug is funny indeed, however I can't reproduce it with your rules.json, whether with a touchpad or a mouse.

From your video it seems that, if a tooltip is displaying, and the button providing it just scroll out of view, the tooltip will refuse to disappear. Is this understanding correct?

Also, please try to reproduce the bug without any mods other than those ThatOrThis depends on.

@Felix14-v2
Copy link
Contributor Author

Felix14-v2 commented Jun 30, 2021

Absolutely right.

button providing it just scroll out of view, the tooltip will refuse to disappear

I disabled all mods (deleted the files and disabled them), but the situation remained the same:
https://youtu.be/TZeGjirvktM
https://youtu.be/ZVQhFWa7j7c

@EZForever
Copy link
Owner

OK I've managed to reproduce the bug, but in a different procedure:

  1. Open ThatOrThis menu;
  2. Select an option by pressing TAB on keyboard, the tooltip will appear around mouse cursor;
  3. Move cursor away or to another option, erratic behavior begins.

My guess is that, by using a touchpad (or maybe some touchpads, as mine works fine) some kind of implied keyboard focus is applied onto the option button. Then the cause of problems surfaced: Minecraft treats keyboard focus the same as mouse hovering (net.minecraft.client.gui.widget.ClickableWidget#isHovered), so there can be at most two buttons in a "hovered" state, causing chaos. I'm working on a fix.

@EZForever
Copy link
Owner

Try this snapshot: thatorthis-0.2.4+1.17@9318c55.jar.zip (unzip before installing). Tooltips for keyboard focused buttons are now not shown. Mouse hovering works as normal.

@Felix14-v2
Copy link
Contributor Author

The result remained the same. However, I do not think that such a small feature is worth so much attention if it is so difficult to detect. If you want, you can close this issue.

By the way, I think this is a simple solution to add small delay after hovering over the button to display the tooltip.

@EZForever
Copy link
Owner

Frankly I don't know what else could go wrong with these tooltips... can't even confirm whether the problem is on my side or not. I'll keep this issue open, but further investgation can't be done without some help.

@EZForever EZForever added the help wanted Extra attention is needed label Jul 1, 2021
@EZForever EZForever mentioned this issue Jul 1, 2021
19 tasks
@EZForever
Copy link
Owner

Okay, maybe by checking mouse poisition against list entries instead of desynchronized button coordinates, we can "force" the tooltip to show only when wanted. Try this snapshot: thatorthis-0.2.4+1.17@b53938e.jar.zip (unzip before installing).

@EZForever EZForever added the bug Something isn't working label Jul 21, 2021
@EZForever EZForever changed the title [1.17] [2.0.4] Tooltip bug Tooltip persists after sudden focus change Jul 21, 2021
@Felix14-v2
Copy link
Contributor Author

Now tooltip works as it should 👍

@EZForever EZForever removed the help wanted Extra attention is needed label Jul 24, 2021
@EZForever
Copy link
Owner

v0.2.5+1.17 is out, containing the fix. Closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants