[Backport to xwayland-23.1] The current fixes from the master branch
This backports:
- commit 1a0cc25d
- commit 79ab129f
- commit a4c70023
- commit 1ac3dd77
- commit 9730fb64
- commit 111d318f
- commit 684580d0
- commit 81458a86
- commit 62b1fac0
- commit c24910d0
- commit da0de3ca
- commit f31ca923
- commit 967ad0fa
- commit 8f7279ad
- commit 636c9aa3
- commit 5ce96a2a
- commit 9a55c402
- commit ad2d461d
- commit eb20ba03
- commit 27133835
- commit 814a0492