BLCM / OpenBLCMM

OpenBLCMM - Borderlands Community Mod Manager
GNU General Public License v3.0
34 stars 2 forks source link

No Wayland Support - OpenBLCMM Crashes on Startup #75

Open nfox18212 opened 5 months ago

nfox18212 commented 5 months ago

System Info https://bpa.st/UU3A Java version: openjdk 21.0.3 2024-04-16 OpenJDK Runtime Environment (Red_Hat-21.0.3.0.9-1) (build 21.0.3+9) OpenJDK 64-Bit Server VM (Red_Hat-21.0.3.0.9-1) (build 21.0.3+9, mixed mode, sharing I do have xwayland installed on my system.

Describe the bug Open BLCMM crashes on startup on my Wayland Desktop (Fedora 40). Message log here: https://bpa.st/23FQ. What caught my eye was on line 14:

No X11 DISPLAY variable was set,
or no headful library support was found,
but this program performed an operation which requires it,

To Reproduce Steps to reproduce the behavior: Run either the launch script or the jar file on a system running Wayland.

apocalyptech commented 5 months ago

Hmm, interesting. I've actually not used Wayland myself yet, so I'm not super familiar, but my impression was that XWayland was supposed to "pretend" to be Xorg for native Xorg apps -- part of that would definitely mean that apps would need a DISPLAY variable set, though I'm not sure about the particulars that'd be involved w/ XWayland.

Could you try running it with something like export DISPLAY=:0.0 and see if that happens to do the trick?

I'll have to look to see if there's something that could be done on the Java side to just support talking Wayland directly; I'm honestly not sure what's available in that space...

nfox18212 commented 5 months ago

I ran DISPLAY=:0.0 java -jar OpenBLCMM.jar and DISPLAY=:0.0 ./launch_openblcmm.sh and it just gives the same output. I've also tried looking into other environment variables like this arch forum post and it still gives the same crash message.

What's weird is that to my understanding, XWayland is supposed to launch and run automatically when an application tries to run an X-specific application. So why its not running now I don't know.

apocalyptech commented 5 months ago

Hmm, had you tried launching w/ GDK_BACKEND=x11 as that thread suggests? (Again just grasping at straws here 'cause I don't have any Wayland experience myself...)

nfox18212 commented 5 months ago

Yeah that's what I did. No change. Same error message as before. I can do some digging on that error message but I have no java experience unfortunately, so I won't be able to help much.

apocalyptech commented 5 months ago

Okay, sounds good. I'll see if I can get a Wayland compositor up on my desktop this weekend so I can try it out myself, too. I know I've been dragging my feet on checking it out, especially since it's starting to become the default on some distros.

apocalyptech commented 5 months ago

Okay, well, getting Wayland up and running was quite simple actually. So I was running into the same error that you were, but in my case it turned out that I simply hadn't told my compositor to start up xwayland. I'd tried weston at first, and enabling it for weston involved editing ~/.config/weston.ini. Once I'd done that (and restarted weston, just in case), OpenBLCMM launched just fine without needing any extra environment vars or the like:

wayland-screenshot-2024-06-07_10-25-15

So I'm wondering if Xwayland wasn't actually enabled properly on your compositor? Merely having it installed might not be enough.

nfox18212 commented 5 months ago

I'm pretty baffled at this point because as far as I can tell using xlsclients, I have xwayland configured and running for several applications at this point like Steam. I've also attempted to force the Kwin compositor to run OpenBLCMM in a rootful xserver with xwayland-run and it does more things but still crashes. Here's the output: https://bpa.st/E2TA. This time, it does spawn a window before crashing.

Additionally, after an extensive round of googling I cannot find any information for manually forcing an application to run with xwayland on Plasma 6. From what I can tell, Plasma runs the xwayland server for me whenever an application needs it. So why on earth is it not for openblcmm?