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

Tooltips stops working after writing code #100713

Closed
Tracked by #88346
Giganzo opened this issue Dec 21, 2024 · 10 comments · Fixed by #101848
Closed
Tracked by #88346

Tooltips stops working after writing code #100713

Giganzo opened this issue Dec 21, 2024 · 10 comments · Fixed by #101848

Comments

@Giganzo
Copy link
Contributor

Giganzo commented Dec 21, 2024

Tested versions

Godot v4.4.dev7

Doesn't look like it happens on v4.4.dev6

System information

Fedora Linux 40 (KDE Plasma) on Wayland - Wayland display driver, Single-window

Issue description

Tooltips stops working after writing some code
Have only seen it happen with prefer Wayland on, so not sure if it can happen with other settings. It doesn't happen every time you write code, so might need to write more or less code until the bug triggers.

Screencast_20241220_043013.webm

Steps to reproduce

Write code and then try to hover over something that triggers a tooltip with documentation help.

Minimal reproduction project (MRP)

N/A

@Giganzo
Copy link
Contributor Author

Giganzo commented Jan 16, 2025

Is this something that should be added to release blockers?
This bug is always triggered after working in a project and writing some amount of code. So if you need help from a tooltip you have to restart the editor to get them back.

@akien-mga
Copy link
Member

Is this something that should be added to release blockers?

Only if it's a regression, and even then, Wayland support is still experimental so I don't think known issues with opting into it would be considered release blocking for 4.4.

@Giganzo
Copy link
Contributor Author

Giganzo commented Jan 17, 2025

Only if it's a regression,

Haven't encountered it before 4.4.dev7

@Riteo
Copy link
Contributor

Riteo commented Jan 20, 2025

Hi, thank you for your report! I'm currently looking into it. It looks like some keys are getting "stuck" for some reason.

@Riteo
Copy link
Contributor

Riteo commented Jan 20, 2025

Welp that was quick. It looks like every single key got stuck in a phantom state that apparently only specific things cared about if the window got unfocused while said keys were pressed. I assumed that the compositor would release them at the right time but I was wrong.

The fix is, like, a single line lol. PR incoming!

Also, FTR, I don't think this is a regression, I always assumed this behavior :P

@Riteo
Copy link
Contributor

Riteo commented Jan 20, 2025

The PR is in, please confirm whether that fixes the issue for you :D

#101819

@Riteo Riteo moved this from For team assessment to Fix pending review in Platforms Issue Triage Jan 20, 2025
@Giganzo
Copy link
Contributor Author

Giganzo commented Jan 20, 2025

Also, FTR, I don't think this is a regression, I always assumed this behavior :P

I see
But it's strange that I cannot trigger it from 4.3 to 4.4.dev6 then. Something must have changed in dev7 to make it have this effect on tooltips now.

The PR is in, please confirm whether that fixes the issue for you :D

No still same problem.

With fix:

Screencast_20250119_182303.webm

4.4.dev6:

Screencast_20250119_182835.webm

There is a difference with the fix, if I tab to another window and back the tooltips will be back. In beta1 I have to restart the editor.

@Riteo
Copy link
Contributor

Riteo commented Jan 20, 2025

@Giganzo I see, thank you for testing the change further. The fact that things work again when you focus/unfocus implies that some buttons still get stuck; not sure how though.

@Riteo Riteo moved this from Fix pending review to In progress / Assigned in Platforms Issue Triage Jan 20, 2025
@Riteo
Copy link
Contributor

Riteo commented Jan 20, 2025

All right, I think I found the final culprit and it's actually quite crazy.

This diff will tell us any stuck keys:

diff --git a/core/input/input.cpp b/core/input/input.cpp
index 4413c426cf..27dfeb12a5 100644
--- a/core/input/input.cpp
+++ b/core/input/input.cpp
@@ -296,6 +296,22 @@ bool Input::is_anything_pressed() const {
 	}
 
 	if (!keys_pressed.is_empty() || !joy_buttons_pressed.is_empty() || !mouse_button_mask.is_empty()) {
+
+		if(!keys_pressed.is_empty()) {
+			print_line("KEYS PRESSED:");
+			for (const Key &key : keys_pressed) {
+				print_line(key);
+			}
+		}
+
+		if(!joy_buttons_pressed.is_empty()) {
+			print_line("JOY BUTTONS PRESSED");
+		}
+
+		if(!mouse_button_mask.is_empty()) {
+			print_line("MOUSE BUTTON MASK");
+		}
+
 		return true;
 	}

After some keyboard mashing it reported only 95, which meant an underscore (_)

I could consistently replicate the issue by:

  1. Pressing Shift and -, resulting in _, and let the key repeat do its job for a second or so;
  2. While keeping the - key pressed, releasing Shift, and let they key repeat do its thing a bit more;
  3. Releasing everything.

I'm quite sure this is related to #99633. That PR correctly makes keys fully Unicode aware but some code somewhere still assumes that the physical key matters, which is not always true.

Update: I think it's the key repetition code that does not handle keyboard state changes properly.

@Riteo Riteo moved this from In progress / Assigned to Fix pending review in Platforms Issue Triage Jan 20, 2025
@Riteo
Copy link
Contributor

Riteo commented Jan 20, 2025

Hi, I pushed a new update which should fix the issue once and for all: #101848

See also issue #100879.

@Riteo Riteo mentioned this issue Jan 21, 2025
41 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Bad
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants