GNOME Bugzilla – Bug 760669
wayland: crash when closing window after drag
Last modified: 2021-07-05 13:49:11 UTC
Reproducer: 1. start GDK_BACKEND=x11 gtk3-demo 2. start Tool palete 3. drag icon/emoticon to quit cross (keep the button pressed), change to another window using Alt+Tab, drop icon (release the press), click on cross After these steps the pointer->focus_surface has dangling reference on destroyed surface and gnome-shell crashes when setting new focus.
Created attachment 319095 [details] [review] repick after ending the grab
I can't reproduce the issue you are describing. As far as I can see we add a destroy listener to the pointer->focus_surface that unsets the focus if it goes away. Are you maybe referring to pointer->current? If so, I think we'd rather need to add a destroy listener to pointer->current surface (or a weak pointer really, since thats pretty much the same with a lot less code).
I can not reproduce the issue anymore too and I don't remember the details. Damn me that I didn't put here better explanation, or at least a backtrace... I think that the problem was that interface->focus (pointer->grab, pointer->current); was called (that is meta_wayland_pointer_set_focus()), the pointer->current was correctly set to NULL (since the focused surface was destroyed), but the pointer->focus_surface was not NULL (it was dangling reference) and gnome-shell crashed. This patch made the code call sync_focus_surface before setting new focus, so focus_surface was correctly NULL.
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/mutter/-/issues/ Thank you for your understanding and your help.