-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Renaming Node Crashes Editor on Linux with i3wm #72707
Comments
Using "rename" from right mouse click context menu is working fine for me. |
In this case, likely something to do with mouse handling - summon @Sauermann |
Actually I have tried this, reading this report. |
FYI I'm on kernel 6.1.8-arch1-1 on arch, X11 i3wm. I'll post more info about this issue if I come across it. |
Just keep clicking. 0.mp4
This may be an i3wm-specific issue. |
Well, I found a related issue #72763, which can be reproduced on i3wm and Cinnamon. |
Can confirm, this happens if I triple click on a node. If done too fast it leads to a segfault coming from here. I'm on i3 as well. This is a recent crash I think. I can try to bisect it. |
So caused by #72497. |
Can't reproduce on i3.
I guess it can happen if the third click arrives before the rename popup window is opened, so it's probably extremely sensitive to timing. But I'm not sure what can cause a crash in the |
While git bisecting, I was reproducing it 100% of the time by clicking a lot on a node. It IS sensitive to timing. |
2023-02-07.13-41-44.mp4 |
It looks like a very tricky one @bruvzg so tell me if there is anything I can do to help |
Also notice how the rename window has an incorrect size/placement on i3 since 9f42649 I'm not getting the crash on gnome. EDIT: I'm wondering if this can happen in other environments as well, except it is pretty much impossible to click again on the node if the rename windows is placed correctly. |
So I'm going to be blunt. I don't want to be disrespectful to @bruvzg who probably spent an enormous amount of time debugging the X11 code (which is quite messy). I salute you :) But, the editor was working perfectly before for me, and I'm not sure what #72370 was trying to fix in the first place? IME dead keys? What is it? They were no issues nor proposals associated with it. If somebody can explain why the original PR was made, what issue it solves and why it was solved this way, it might give somebody a chance to debug this. Otherwise I suggest just reverting the four commits I mentioned (which are, in reality 1 commit and 3 subsequent bugfixes) because they led to numerous issues on X11 and wayland. |
@geowarin If you search for "dead keys" you'll see quite a lot of issues. My understanding is that #18020 broke people's ability to use dead keys (which are quite common, e.g. the Spanish and International US layouts use them). 72370 makes it possible to use those layouts again (because without it, only IME input works, which is to mean, Chinese/Japanese dead keys, but not Western dead keys because they don't rely on IME) |
Ok thanks @Zireael07, that explains the "why?" But what does IME has to do with popups? What is the "IME window"? Why is it leaking into Godot's code? |
IME require an invisible sub-window to work (which determine candidate window drawing position, and dispatching input event to the IME engine). So each time a LineEdit or TextEdit is focused, the IME window is mapped and input focus is transferred to it. IME engines and WMs (especially on XWayland) are quite inconsistent in handling it and sensitive to window focus. Before IME support was implementation, all popups (including the node rename popup) were unfocusable, but this does not work on XWayland (it locks all input when focus is transferred to IME sub-window), so it was changed to be focusable. Dead keys without IME (input key handling changes) are not directly related to the issue or IME implementation, it was never supported before and was found only during IME issues debugging. |
Thanks @bruvzg! So #72370 tries to fix two problems at once:
Are those IME window focus problems only appearing on XWayland? |
KDE on XWayland in particular, see #72074 (this is not the only issue, there were some other as well).
No, all keyboards are physically the same. You need to enable IME (usually ibus or fcitx) and add any of the IME enabled keyboard layout (IME setup might be as easy as adding it in the keyboard settings, or running |
No, it's the same with or without IME, all modern distros should have IME enabled (even if you do not have keyboard layout configured) by default. Note: If IME is fully disabled, Godot will print
Yes, rename popup are too big on i3. But no matter what I try, the third click always lands inside a popup and cause text selection, not popup closing. The only thing I suspect can have some effect is event callback not being cleaned. Try adding the following code to the void Window::_clear_window() {
ERR_FAIL_COND(window_id == DisplayServer::INVALID_WINDOW_ID);
+ DisplayServer::get_singleton()->window_set_rect_changed_callback(Callable(), window_id);
+ DisplayServer::get_singleton()->window_set_window_event_callback(Callable(), window_id);
+ DisplayServer::get_singleton()->window_set_input_event_callback(Callable(), window_id);
+ DisplayServer::get_singleton()->window_set_input_text_callback(Callable(), window_id);
+ DisplayServer::get_singleton()->window_set_drop_files_callback(Callable(), window_id);
+
if (transient_parent && transient_parent->window_id != DisplayServer::INVALID_WINDOW_ID) {
DisplayServer::get_singleton()->window_set_transient(window_id, DisplayServer::INVALID_WINDOW_ID);
} |
The code you provided does fix the problem for me! Amazing 😄 I have no |
Great, I have opened PR - #73239. |
Godot version
4.0.beta17
System information
Linux.x86_64
Issue description
Renaming a node in the scene tree by double clicking randomly crashes the running editor instance with the following error message:
The error occurs about 8 out of 10 times.
Steps to reproduce
Minimal reproduction project
A blank project with no scene produces this error.
The text was updated successfully, but these errors were encountered: