-
Notifications
You must be signed in to change notification settings - Fork 260
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
"Don't ask, don't tell" focus hack causes gnome-shell to freeze for seconds / Xwayland to crash #714
Comments
I accidentally hit submit before actually writing my bug report. I have just edited the original description to actually be a proper bug report, so if you are following this via email, please check the new description on github.com. Here is my terminator config.txt, which is necessary to reproduce this problem. |
I've had a similar (or exact same) issue where using terminator in wayland will 'cause gnome shell to freeze up for a few seconds, and the mouse cursor will rapidly blink the wait spinner while something is preventing terminator from launching. Opening a separate application window (e.g. nautilus) and focusing that window will cause terminator to draw the window. This isn't exhibited in "gnome on xorg" mode. I've found that removing the |
The problematic code block starts with 'if self.last_active_window:' so yes disabling the last_active_window option should workaround this. Maybe that option should simply be removed all together? Or at least default to off ? |
Oh it very much defaults to off, but you do have it set in your config, so that's why you're running into this problem. I made #716 that should non-heroically fix the problem. It just sets the focus to be the last_active_window specified in the config, and leaves it at that. Can you try it out and make sure that it works as you expect? |
The original commit actually explains in a comment why Steve Boddy did such a thing. It makes for interesting reading. |
I've tried the branch out, and it seems to be working fine on my end, though I can't say with absolute certainty. My testing process went as follows:
Looks good on my end. Thank you, @mattrose! |
Ah, I don't remember turning that on and I cannot find it anywhere in the settings UI. But maybe I'm just not looking in the right place.
Thanks, that looks good to me (I didn't find the time to test, sorry). |
This is what "terminator" (the terminal emulator) does, it basically calls gdk_window_focus() in a loop thousands of times at startup. This in turn fills up the Wayland connection between Xwayland and mutter, and eventually the session dies. See-also: gnome-terminator/terminator#714 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2849>
@jwrdegoede those config parameters get turned on when you save a layout. They tell terminator which window and terminal to focus on when the layout is completely done. I'm gonna merge this in now. Thanks @krnhotwings for testing it out. |
Lately I have been having these weird issues where gnome-shell freezes for second and often Xwayland crashes. I have been working with the mutter + Xwayland devs to get to the bottom of this.
Let me copy and paste the summary which I added to a related (workaround) mutter pull-request for this:
I have been seeing mutter freezing for seconds / Xwayland crashes / mutter crashes when starting terminator for a while now.
After collecting backtraces I emailed @carlosg and @ofourdan to see if we could make sense of this.
The Xwayland logs showed a crash due to running out of libwayland buffer space and the crashes actually go away with: https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/188 which makes libwayland dynamically grow the buffer.
The mutter backtrace showed mutter crashing inside meta-x11-display: update_cursor_theme(), it seems that if Xwayland crashes at the wrong moment it manages to take mutter down with it. These too appear to be resolved by the libwayland change to dynamically grow the buffer.
If Xwayland no longer crashes then things just freeze for a couple of seconds when starting terminator and after that everything works normally again.
Commenting out the g_signal_connect_object("cursor-updated", update_cursor_theme) call can be used as a workaround for the freezes.
@ofourdan has managed to reproduce this by using my ~/.config/terminator/config file. I will attach that here. For me this reproduces by just starting terminator with this config in a gnome-shell which has already had at least one other app opened. I'm on a fully up2date Fedora 37 install.
Further debugging has turned out that this is caused by repeated
gdk_window_focus()
API calls. Which lead me to:terminator/terminatorlib/terminator.py
Line 349 in 403bf54
It looks like to me like this workaround is causing more harm then whatever focus issue it is trying to fix., so maybe remove it?
You can reach out to the gnome-shell devs in: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2849 Where a workaround for this terminator mis-behavior is being discussed. I'm sure they would be happy to discuss a better way to deal with whatever focus issue this is trying to fix (or at least fix it under gnome-shell).
The text was updated successfully, but these errors were encountered: