-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Text editor steals focus from "Find in Files" dialog #88847
Comments
I also have this issue in 4.3-dev3 -- I was about to report it myself My specs: Version that's bugged: (ctrl-shift-f isn't usable without a mouse click to refocus the popup)
Version without the bug:
|
Tested and this doesn't seem to work in current CC @bruvzg @KoBeWi - maybe we can improve the Find in Files focus handling logic to make it less dependent on the timing of events. |
Well call deferred is usually a way to fix such issues, because you make something happen last (in most cases). It would be nice to know what causes the focus steal. I can't reproduce it on Windows (tried single window mode, as it can't even happen with multiple windows). |
For me on Linux (Fedora 40, KDE Plasma on Wayland, X11 DisplayDriver) the issue is only reproducible with multiple windows actually, and not reproducible in single window mode. |
Huh I tested with multiple windows and seems like you can focus the editor, it just doesn't accept input. |
This has been a little tricky for me to reproduce. It's not reproducible on my system (Ubuntu 22.04) with i3 (my usual environment) or GNOME. I used multiple window mode in both cases, and tried both Forward+ and Compatibility (above, someone said it happened for them only on Forward+ and not Compatibility). However, I just setup a Fedora 40 VM in VirtualBox, and I am able to reproduce the issue there! (using Compatibility, since getting Vulkan running in VirtualBox is a pain) Strangely, that is also GNOME, however, it looks like it's running on Wayland and so using xwayland. I wonder if that's the difference? On my host machine, I'm using real X11 in order to take advantage of the proprietary nvidia drivers. It'd be great if other folks who are experiencing this issue could share:
In any case, I'll experiment with some changes to the code that was committed in PR #86441 to see if I can find a workaround. |
I reproduce the issue on Fedora 40 KDE Plasma/KWin on Wayland myself, so using XWayland. I can test tomorrow if it's indeed not reproducible on the same system with KDE X11. |
I just posted draft PR #93682 which fixes the issue in my testing. I don't know if it reintroduces the bugs that PR #86441 aimed to fix, though, and I'm going to attempt to determine that. In any case, I'd appreciate it if other folks who are experiencing the bug described here could test if my PR fixes it for you as well! |
Tested versions
System information
Godot v4.3.dev3 - Debian GNU/Linux 11 (bullseye) 11 - X11 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3060 Ti () - 11th Gen Intel(R) Core(TM) i5-11600K @ 3.90GHz (12 Threads)
Issue description
Text editor steals focus
when nothing is selected before invokingfrom "Find in Files" dialog.Steps to reproduce
Don't select anything.My attempt to fix
Tried to investigate "editor/find_in_files.cpp" ("FindInFilesDialog::_notification") and found that if replace
callable_mp((Control *)_search_text_line_edit, &Control::grab_focus).call_deferred();
with
_search_text_line_edit->grab_focus();
the problem is gone.
Not sure about "Doesn't work more than once if not deferred..." comment. It works normally subsequently (at least on my Linux with v.4.3-dev3).
Minimal reproduction project (MRP)
N/A
The text was updated successfully, but these errors were encountered: