Skip to content

Commit

Permalink
syswm: Added a quirk to disable SysWM interfaces.
Browse files Browse the repository at this point in the history
And hooked up "fillets" to it.

Reference Issue #234.
  • Loading branch information
icculus committed Oct 11, 2022
1 parent 92fe60a commit 63e4393
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,18 @@ The available options are:
completely ignored.
The thread that called `SDL_SetVideoMode()` is treated as the main thread.

- SDL12COMPAT_ALLOW_SYSWM: (checked during SDL_Init)
Enabled by default.
If disabled, SDL_SYSWMEVENT events will not be delivered to the app, and
SDL_GetWMInfo() will fail; this is useful if you have a program that
tries to access X11 directly through SDL's interfaces, but can survive
without it, becoming compatible with, for example, Wayland, or perhaps
just avoiding a bug in target-specific code. Note that sdl12-compat already
disallows SysWM things unless SDL2 is using its "windows" or "x11" video
backends, because SDL 1.2 didn't have wide support for its SysWM APIs
outside of Windows and X11 anyhow.


# Compatibility issues with OpenGL scaling

The OpenGL scaling feature of sdl12-compat allows applications which wish to
Expand Down
7 changes: 7 additions & 0 deletions src/SDL12_compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -1207,6 +1207,9 @@ static QuirkEntryType quirks[] = {
{"tucnak", "SDL_RENDER_DRIVER", "software"},
{"tucnak", "SDL_FRAMEBUFFER_ACCELERATION", "false"},

/* looks for X11 display and does unnecessary X11 things. Causes problems with SDL2/x11. */
{"fillets", "SDL12COMPAT_ALLOW_SYSWM", "0"},

/* The 32-bit Steam build only of Multiwinia Quits but doesn't re-Init */
{"multiwinia.bin.x86", "SDL12COMPAT_NO_QUIT_VIDEO", "1"}
#else
Expand Down Expand Up @@ -2254,6 +2257,10 @@ Init12Video(void)
SupportSysWM = SDL_FALSE;
#endif

if (!SDL12Compat_GetHintBoolean("SDL12COMPAT_ALLOW_SYSWM", SDL_TRUE)) {
SupportSysWM = SDL_FALSE;
}

SDL_EnableKeyRepeat(0, 0);

SDL20_DelEventWatch(EventFilter20to12, NULL);
Expand Down

0 comments on commit 63e4393

Please sign in to comment.