Revert "Revert "Revert "[3.0] Fix crash in wayland"""