So to quickly summarize, whenever the line above runs on an x11 system the game crashes. This is because CursorGrabMode::Locked is not implemented for x11 and Windows but is for Wayland and MacOS. The X11 and Windows equivalent of the statement seems to be CursorGrabMode::Confined.
So the solution is relatively simple, we just need an if statement where if the user is running on either MacOS or Wayland we use CursorGrabMode::Locked otherwise we use CursorGrabMode::Confined. This is exactly how infernaa fixed the issue in https://github.com/iceiix/stevenarella/issues/714
So I could successfully run Leafish on Wayland but it would crash immediately upon running in X11.
I deduced it was because of the line which is used a couple times in the code
so the same as the stevenarella issue https://github.com/iceiix/stevenarella/issues/714 which we inadvertently recreated in our fork with the pull request https://github.com/Lea-fish/Leafish/pull/262
So to quickly summarize, whenever the line above runs on an x11 system the game crashes. This is because
CursorGrabMode::Locked
is not implemented for x11 and Windows but is for Wayland and MacOS. The X11 and Windows equivalent of the statement seems to beCursorGrabMode::Confined
.So the solution is relatively simple, we just need an if statement where if the user is running on either MacOS or Wayland we use
CursorGrabMode::Locked
otherwise we useCursorGrabMode::Confined
. This is exactly how infernaa fixed the issue in https://github.com/iceiix/stevenarella/issues/714further detail on both the enums are below
https://docs.rs/winit/latest/winit/window/enum.CursorGrabMode.html