libsdl-org / sdl12-compat

An SDL-1.2 compatibility layer that uses SDL 2.0 behind the scenes.
Other
193 stars 40 forks source link

grafx2: BadWindow when running on xorg (fine on wayland) #282

Closed spotrh closed 1 year ago

spotrh commented 1 year ago

User reported that grafx2 would no longer start at all on Fedora 37, but only on xorg (works fine on wayland). Confirmed locally.

X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  18 (X_ChangeProperty)
  Resource id in failed request:  0x0
  Serial number of failed request:  315
  Current serial number in output stream:  316

Passing SDL12COMPAT_ALLOW_SYSWM=0 quirk resolves the crash, but I was not sure if it would be appropriate to add grafx2 to the list of binaries needing this value or if there was a more appropriate code fix for grafx2 (it is FOSS).

icculus commented 1 year ago

Yeah, grafx2 does all kinds of wild stuff directly talking to the X server, largely to fill in functionality that's missing from SDL 1.2, like clipboard access and such.

Best course of action here is just to disable syswm, as you said.

It's worth noting that grafx2 can be built with SDL2 support (it needs USE_SDL2 defined instead of USE_SDL). I mention this because apparently Ubuntu and/or Debian is shipping it built for SDL2, so it might be worth opening a bug with Fedora about that.

But for the SDL 1.2 build, I'll push a fix here.

smcv commented 1 year ago

apparently Ubuntu and/or Debian is shipping it built for SDL2

Since 2018, according to the package's changelog. When I tried to test all the remaining SDL 1.2 games in Debian against sdl12-compat, to keep the scope somewhat manageable, I only tested the ones that are still going to use SDL 1.2 in Debian 12 (expected to be released mid 2023), and ignored the ones that had been successfully ported to SDL 2 already. We generally try to use SDL 2 in codebases that can do both.

spotrh commented 1 year ago

I totally missed that grafx2 had SDL2 support. I'll move it to using that in Fedora.