Open vchernin opened 3 years ago
Thanks for the ticket! I would love native Wayland support, but on the other hand I am not sure whether I like adding unofficial third-party hacks that can broke after a new game update. :-/
Yeah that’s definitely understandable, maybe the patches could be tested out in the Flathub beta branch?
I managed to get the patched GLFW to build in the Flatpak. Native Wayland doesn't actually work yet but it's progress. See https://github.com/vchernin/com.mojang.Minecraft
A few things I've noticed:
I could not add the -DCMAKE_INSTALL_PREFIX=/usr
cmake option to the config, it causes the build to fail with a permission error. This makes sense since it's trying to write to /usr from a flatpak, which we can't do (nor do we want to).
I tried to follow how the GLFW documentation wanted me to compile it, but in the end their steps didn't seem necessary at all. Basically just translating that Arch build script was enough.
I have no idea where the built GLFW actually goes yet when the Flatpak is installed, or if it even goes anywhere. I tried to follow ideas suggested here.
The repo with patches says:
If you don't want to [use MultiMC], throw this into your Java arguments, changing the file path as needed:
-Dorg.lwjgl.glfw.libname=/usr/lib/libglfw.so
I am not sure how exactly to do this, but it does seem like something that's needed to utilize the patched GLFW. Again this is a directory location problem.
Also for some reason my changes break the desktop icon (edit: apparently not anymore)
I could open a PR against master for this, or if a beta branch could be created I could open a PR against that. Edit: See #85
I don't think this is a good idea... It has the potential to break things (and does break things), for example Forge on 1.13+ doesn't work until you disable a feature of it. And I'm pretty sure it doesn't apply at all to older versions.
I don't think this is a good idea...
It has the potential to break things (and does break things), for example Forge on 1.13+ doesn't work until you disable a feature of it.
And I'm pretty sure it doesn't apply at all to older versions.
If you're referring to the stuff going on in #96, yes it's problematic which is why I don't think it makes sense to merge. The point there is making it easier to test the changes in GLFW so they can be merged upstream.
But if you're referring to Wayland in GLFW and other apps in general, well that's an inevitability at this point.
If you do have issues running in Wayland natively I'd suggest reporting them to the relevant PRs in GLFW, which reminds me I should probably do the same.
I don't mean GLFW in general, just here. Don't mess around with GLFW, keep the builds Mojang bundles. and... that window icons require an app id or xwayland on wayland should probably be changed... (but that's only loosely related here, icons are one of the GLFW features used by Minecraft)
There are patches for GLFW which let Minecraft run in native Wayland mode. This is beneficial to avoid a dependency on xwayland for Wayland users. Theoretically we could put a patched GLFW in the Flatpak (although I’m not sure how exactly).