x11: added hotplug support for XInput2 devices

This commit is contained in:
Sam Lantinga
2024-03-25 20:41:05 -07:00
parent f1f24b173c
commit 3dfc3b4c8d
4 changed files with 161 additions and 55 deletions
+7
View File
@@ -29,6 +29,7 @@
#include <limits.h> /* For INT_MAX */
#include "SDL_x11video.h"
#include "SDL_x11pen.h"
#include "SDL_x11touch.h"
#include "SDL_x11xinput2.h"
#include "SDL_x11xfixes.h"
@@ -2033,6 +2034,12 @@ void X11_PumpEvents(SDL_VideoDevice *_this)
X11_FlashWindow(_this, data->windowlist[i]->window, SDL_FLASH_CANCEL);
}
}
if (data->xinput_hierarchy_changed) {
X11_InitPen(_this);
X11_Xinput2UpdateDevices(_this, SDL_FALSE);
data->xinput_hierarchy_changed = SDL_FALSE;
}
}
int X11_SuspendScreenSaver(SDL_VideoDevice *_this)
+1
View File
@@ -111,6 +111,7 @@ struct SDL_VideoData
Uint32 global_mouse_buttons;
SDL_XInput2DeviceInfo *mouse_device_info;
SDL_bool xinput_hierarchy_changed;
int xrandr_event_base;
File diff suppressed because it is too large Load Diff
+1
View File
@@ -39,5 +39,6 @@ extern void X11_Xinput2SelectTouch(SDL_VideoDevice *_this, SDL_Window *window);
extern void X11_Xinput2GrabTouch(SDL_VideoDevice *_this, SDL_Window *window);
extern void X11_Xinput2UngrabTouch(SDL_VideoDevice *_this, SDL_Window *window);
extern SDL_bool X11_Xinput2SelectMouseAndKeyboard(SDL_VideoDevice *_this, SDL_Window *window);
extern void X11_Xinput2UpdateDevices(SDL_VideoDevice *_this, SDL_bool initial_check);
#endif /* SDL_x11xinput2_h_ */