From 715c18739b63c3be6a49b249a781487e68fc4dc5 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Tue, 11 Feb 2025 15:00:01 -0800
Subject: [PATCH] Added an internal hint "SDL_VIDEO_X11_XINPUT2" for
sdl2-compat
---
src/video/x11/SDL_x11xinput2.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/video/x11/SDL_x11xinput2.c b/src/video/x11/SDL_x11xinput2.c
index caee30764d5de..0b7665342e501 100644
--- a/src/video/x11/SDL_x11xinput2.c
+++ b/src/video/x11/SDL_x11xinput2.c
@@ -129,6 +129,11 @@ bool X11_InitXinput2(SDL_VideoDevice *_this)
unsigned char mask[4] = { 0, 0, 0, 0 };
int event, err;
+ /* XInput2 is required for relative mouse mode, so you probably want to leave this enabled */
+ if (!SDL_GetHintBoolean("SDL_VIDEO_X11_XINPUT2", true)) {
+ return false;
+ }
+
/*
* Initialize XInput 2
* According to http://who-t.blogspot.com/2009/05/xi2-recipes-part-1.html its better