Skip to content

shell-global: Disconnect from stage events on X11 display close

As per mutter!385 (merged) [1], the compositor is finalized an its pointer cleared on display close.

However, since the shell reacts to such events instead of controlling them, when the shell is stopping or restarting and its display closing, the shell stage destroys its children after the display closing is finished and during this process the focus is unset, causing focus_actor_changed() to be called and thus calls to meta_stage_is_focused() which deferences the now NULL compositor, leading to a crash on shutdown.

Since after this point we should just ignore any stage event, disconnect from them all.


This leads to a quite frequent crash when shutting down the shell under X11 (see ubuntu bug 1843512).

While the proper fix IMHO is instead to do what !648 (closed) (and mutter!682 (closed)) is proposing, ensuring the shell leads the shutdown by cleaning up its resources first, and then closing the lower-level ones, such changes aren't suitable for a stable branch, and so this is the best way.

In theory only focus_actor_changed callback could be stopped, but considering that we call the disconnection just once I think is better to just ignore everything.

Merge request reports