sdl2-compat: Added a quirk for Write to disable SDL XInput2 handling

From b5ef9b1ba72cca7c617b242f36dbd48e33f98423 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Tue, 11 Feb 2025 15:02:05 -0800
Subject: [PATCH] Added a quirk for Write to disable SDL XInput2 handling

Write does it's own XInput2 event handling and tries to disable SDL's handling. This doesn't work with SDL3 because SDL calls XISelectEvents() with XIAllDevices instead of XIAllMasterDevices. So we added a hint "SDL_VIDEO_X11_XINPUT2" to solve this.

Fixes https://github.com/libsdl-org/sdl2-compat/issues/274
---
 src/sdl2_compat.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/sdl2_compat.c b/src/sdl2_compat.c
index 51e5da51..5646bd83 100644
--- a/src/sdl2_compat.c
+++ b/src/sdl2_compat.c
@@ -441,11 +441,14 @@ typedef struct QuirkEntryType
 
 static QuirkEntryType quirks[] = {
     /* TODO: Add any quirks needed for various systems. */
-    /*{"my_game_name", "SDL_RENDER_BATCHING", "0"},*/
+    /*{ "my_game_name", "SDL_RENDER_BATCHING", "0" },*/
 
     /* Apps that support high DPI properly under Wayland */
-    {"moonlight", SDL_HINT_VIDEO_WAYLAND_SCALE_TO_DISPLAY, "0"},
-    {"moonlight-qt", SDL_HINT_VIDEO_WAYLAND_SCALE_TO_DISPLAY, "0"},
+    { "moonlight", SDL_HINT_VIDEO_WAYLAND_SCALE_TO_DISPLAY, "0" },
+    { "moonlight-qt", SDL_HINT_VIDEO_WAYLAND_SCALE_TO_DISPLAY, "0" },
+
+    /* Stylus Labs Write does its own X11 input handling */
+    { "Write", "SDL_VIDEO_X11_XINPUT2", "0" },
 };
 
 #ifdef __linux__