Similar to what we did in mutter Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3507>