e91062aaec
Where much of the logic was introduced in commit 14c706e51b Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1619>