Bump GLFW to 3.4, fix Wayland Configurations #16
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR should address #12 and several other issues mentioned via Zulip.
The major changes are:
Bumping GLFW from 3.3 to 3.4: This is done as older versions of GLFW under Wayland did not properly support adding window decorations (this is a general change to how client and server side decorations work). GLFW 3.3.9 and 3.4 added support for libdecor to automatically populate the window decorations. This will require installing the libdecor-0-dev and libdecor-0-plugin-1-cairo packages via snap, or similar. Note that on some older Ubuntu versions, e.g., 20.04, these packages do not exist even though Wayland is supported, so those configurations will not have working window decorations and we cannot fix this.
Changes to CMake Setup: To add proper support for Wayland we need to force GLFW to use either x11 or Wayland depending on the system as relying on the GLFW build script in this case can lead to issues (this may be avoidable in some cases by manually modifying their scripts but this is not a solid fix in every configuration). To do this we use the XDG_SESSION_TYPE environment variable that should be set on all sane systems. If this variable is not set, which is the case on WSL2, we can use this behavior to force Wayland by default, which makes WSL2 setups run. This should not break any previously non-working setups.
Added USE_WAYLAND and USE_X11 CMake Options: In case someone wants to manually force either X11 or Wayland we now have a configuration flag for this purpose.
This branch has worked on WSL2 (Ubuntu 20.04), Windows, XUbuntu 24.04 (X11), MacOS and Arch + Hyprland (on some setups) thus far and has broken on none.