libsdl-org / sdl12-compat

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

SysWW/X11: Return the X11 window as wmwindow and x11window #292

Closed sulix closed 1 year ago

sulix commented 1 year ago

Steel Storm (and presumably other darkplaces, SDL 1.2-based games) expect x11.wmwindow to be valid if they've created a window and are running under X11. Just pass the same game window like we do for x11.window.

See the old darkplaces code here: https://github.com/xonotic/darkplaces/blob/a0465ad2ee16719587b0b7a80d4c1c2f7df1ac0e/vid_sdl.c#L2334

This should fix the BadWindow errors on Steel Storm Burning Retribution (issue #290)

smcv commented 1 year ago

@icculus, was 4c22ab5 intended to be a functional change? If temp_window is true, before that commit all three window IDs were set to 0, but after that commit fswindow and wmwindow will be set to the temporary window.

I suspect you might have meant this?

-            info12->info.x11.fswindow = info20.info.x11.window;
-            info12->info.x11.wmwindow = info20.info.x11.window;
+            info12->info.x11.fswindow = info12->info.x11.window;
+            info12->info.x11.wmwindow = info12->info.x11.window;

(Sorry, I'm not able to re-test #290 with this change at the moment.)

icculus commented 1 year ago

Shoot, good catch, I pasted the wrong thing. 😬