Flappy Dragon Crashes on mouse over window on Linux with XWayland

@herbert

Flappy Dragon Example:

Sync this code, and then copy the flappy_dragon director into another outside of the HandsOnRust tree (i.e. as if you were just following the example in the book).

On Linux when you run (cargo run) and mouse over the game window, the app window closes (crashes?) with the following error:

Error sending request: Resource temporarily unavailable

This only occurs when running under XWayland. If you switch the X11 every thing runs fine.

Note, if you run directly from the source tree, everything runs ok. There seems to be some setting or config (not covered in the book) in the parent directory / cargo.toml file causing different behavior.

System info:

PRETTY_NAME=“Ubuntu 22.04.1 LTS”
NAME=“Ubuntu”
VERSION_ID=“22.04”
VERSION=“22.04.1 LTS (Jammy Jellyfish)”
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL=“https://www.ubuntu.com/
SUPPORT_URL=“https://help.ubuntu.com/
BUG_REPORT_URL=“Bugs : Ubuntu
PRIVACY_POLICY_URL=“https://www.ubuntu.com/legal/terms-and-policies/privacy-policy
UBUNTU_CODENAME=jammy

rust info:

rustup 1.25.1 (bb60b1e89 2022-07-12)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active rustc version is rustc 1.64.0 (a55dd71d5 2022-09-19)