Closed smcv closed 1 year ago
This appears to be a game based on darkplaces (modified Quake).
The same versions work well on a different test machine with: Debian 12 prerelease, AMD vega10, Mesa; and either GNOME (Wayland) or Xfce (Xorg). At this stage I'm unsure whether it's Ubuntu vs Debian or NVIDIA vs AMD/Mesa that is significant.
For an apples-to-apples comparison, I booted both test machines into Debian 11 stable with GNOME (Xorg) and the same game works fine there; so this might be Ubuntu-specific or NVIDIA-driver-version-specific.
I won't be able to test Ubuntu 22.04 on AMD or Debian 12 on NVIDIA until I've installed the relevant operating systems, which will take a while.
So, interestingly, I couldn't reproduce this (with the full game, not the demo) just running the game through Steam (both with and without the pressure-vessel 'Steam Linux Runtime') on openSUSE Tumbleweed with nVidia/KDE/Wayland.
However, if I ran the game directly (instead of via Steam), I get the same BadWindow error.
It looks like the game is trying to set a window icon, and is passing NULL as the Window:
(gdb) bt
#0 XChangeProperty (dpy=0x2894c30, w=0, property=331, type=6, format=32, mode=0, data=0x797c00 "", nelements=65538) at /usr/src/debug/libX11-1.8.4/src/ChProp.c:42
#1 0x0000000000404441 in ?? ()
#2 0x0000000000408202 in ?? ()
#3 0x0000000000678135 in ?? ()
#4 0x000000000067be17 in ?? ()
#5 0x0000000000543b7b in ?? ()
#6 0x000000000047948d in ?? ()
#7 0x0000000000541267 in ?? ()
#8 0x0000000000542b63 in ?? ()
#9 0x0000000000404053 in ?? ()
#10 0x00007ffff7b3cbb0 in __libc_start_call_main (main=main@entry=0x403fe0, argc=argc@entry=1, argv=argv@entry=0x7fffffffd838) at ../sysdeps/nptl/libc_start_call_main.h:58
#11 0x00007ffff7b3cc79 in __libc_start_main_impl (main=0x403fe0, argc=1, argv=0x7fffffffd838, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffd828)
at ../csu/libc-start.c:360
#12 0x0000000000403c59 in ?? ()
#13 0x00007fffffffd828 in ?? ()
#14 0x0000000000000038 in ?? ()
#15 0x0000000000000001 in ?? ()
#16 0x00007fffffffdd40 in ?? ()
#17 0x0000000000000000 in ?? ()
(gdb) call XGetAtomName((Display*)0x2894c30, 331)
$1 = 0x30ad9d0 "_NET_WM_ICON"
Using either SDL12COMPAT_ALLOW_SYSWM=0
or forcing the game to use wayland with SDL_VIDEODRIVER=wayland
both fixed it.
both with and without the pressure-vessel 'Steam Linux Runtime'
FYI, I wasn't using the container/pressure-vessel "Steam Linux Runtime" for this testing, only the legacy LD_LIBRARY_PATH
-based runtime. Currently the container runtime is the default on Steam Deck, and the legacy LD_LIBRARY_PATH
-based runtime is the default everywhere else.
I think openSUSE does some nasty patching to force Steam to use the distro versions of some libraries, rather than the Steam Runtime versions, so that might explain some of the differences.
/proc/pid/maps definitely gives the distro version of sdl12-compat by default when launching through Steam, and it's exactly the same library running when I get BadWindow locally. Swapping out a self-compiled sdl12-compat doesn't change anything.
(There are a bunch of other libraries which come from the steam runtime when run via Steam, and the distro otherwise, but SDL doesn't seem to be one of them. Just: libnettle.so.6.2
, libhogweed.so.4.2
, librtmp.so.0
, libidn.so.11.6.15
, libcurl.so.4.2.0
. None of which seem likely to be related.)
I managed to track down the darkplaces code that causes the issue: https://github.com/xonotic/darkplaces/blob/a0465ad2ee16719587b0b7a80d4c1c2f7df1ac0e/vid_sdl.c#L2334
It's using the x11.wmwindow field, which sdl12-compat never sets (as there's no SDL2 equivalent). Just setting it to be the same as x11.window fixes it for me (see PR #292), and is only slightly incorrect. (I did the same for x11.fswindow as well, just in case).
Otherwise, adding a quirk to disable SDL12COMPAT_ALLOW_SYSWM seems like the other valid solution: the game has decent fallbacks if SysWM is unavailable.
This appears to be a game based on darkplaces (modified Quake).
Being GPL'd code, you'll find this in your Steam install, too, fwiw:
$HOME/.local/share/Steam/steamapps/common/steelstorm/engine_source.zip
It's using the x11.wmwindow field, which sdl12-compat never sets (as there's no SDL2 equivalent). Just setting it to be the same as x11.window fixes it for me (see PR https://github.com/libsdl-org/sdl12-compat/pull/292), and is only slightly incorrect. (I did the same for x11.fswindow as well, just in case).
I think this is the correct fix. There's no need to turn off sywm with a quirk, as it uses the API correctly, including when not running on X11, and doesn't do anything that seems to upset things if available.
Okay, this is fixed by 32a06ea1f13a1e516a2e0f8e0dcf266fa1d88ada, thanks!
Confirmed fixed with 1.2.64 + 2.26.5.
To reproduce:
LD_LIBRARY_PATH
(I used a modified Steam Runtime replacing its bundled legacy SDL 1.2 with a backport of 1.2.62, based on 1.2.62-1 in Debian experimental)SDL12COMPAT_ALLOW_SYSWM=0
additionally in the environmentExpected result: all runs succeed
Actual result:
SDL12COMPAT_ALLOW_SYSWM=0
: OK