mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-10-02 16:23:57 +08:00
x11: added hotplug support for XInput2 devices
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
+152
-55
File diff suppressed because it is too large
Load Diff
@@ -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_ */
|
||||
|
||||
Reference in New Issue
Block a user