From: EBADBEEF errno@ebadf.com
Major refactor of xinput2 handling.
When a window is focused, subscribe to xinput2 events. Likewise when a window is unfocused, unsubscribe from xinput2 events.
If there are any unfocused windows that want rawinput, they need to set RIDEV_INPUTSINK and wineserver will be responsible for delivering events to them.
To quote from xorg-xserver: XI 2.0: events delivered to the grabbing client (if any) OR to all root windows XI 2.1: events delivered to all root windows, regardless of grabbing state.
Using the focus/unfocus logic should hopefully still make sense. I do not think it is possible to grab a pointer from an unfocused window. However, no rawinputs would be delivered until the pointer is grabbed. For this reason I bumped the XInput2 version request to 2.1 (released Dec 2011). This could be managed another way (perhaps by setting noraw_flags based on thread_data->xi2_state). --- dlls/winex11.drv/event.c | 63 +----- dlls/winex11.drv/mouse.c | 411 ++++++++++++++------------------------ dlls/winex11.drv/x11drv.h | 11 +- 3 files changed, 150 insertions(+), 335 deletions(-)
diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index 97bec34b0ea..5e024127a97 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -148,8 +148,6 @@ static const char * event_names[MAX_EVENT_HANDLERS] = /* is someone else grabbing the keyboard, for example the WM, when manipulating the window */ BOOL keyboard_grabbed = FALSE;
-int xinput2_opcode = 0; - /* return the name of an X event */ static const char *dbgstr_event( int type ) { @@ -264,46 +262,6 @@ enum event_merge_action MERGE_IGNORE /* ignore the new event, keep the old one */ };
-/*********************************************************************** - * merge_raw_motion_events - */ -#ifdef HAVE_X11_EXTENSIONS_XINPUT2_H -static enum event_merge_action merge_raw_motion_events( XIRawEvent *prev, XIRawEvent *next ) -{ - int i, j, k; - unsigned char mask; - - if (!prev->valuators.mask_len) return MERGE_HANDLE; - if (!next->valuators.mask_len) return MERGE_HANDLE; - - mask = prev->valuators.mask[0] | next->valuators.mask[0]; - if (mask == next->valuators.mask[0]) /* keep next */ - { - for (i = j = k = 0; i < 8; i++) - { - if (XIMaskIsSet( prev->valuators.mask, i )) - next->valuators.values[j] += prev->valuators.values[k++]; - if (XIMaskIsSet( next->valuators.mask, i )) j++; - } - TRACE( "merging duplicate GenericEvent\n" ); - return MERGE_DISCARD; - } - if (mask == prev->valuators.mask[0]) /* keep prev */ - { - for (i = j = k = 0; i < 8; i++) - { - if (XIMaskIsSet( next->valuators.mask, i )) - prev->valuators.values[j] += next->valuators.values[k++]; - if (XIMaskIsSet( prev->valuators.mask, i )) j++; - } - TRACE( "merging duplicate GenericEvent\n" ); - return MERGE_IGNORE; - } - /* can't merge events with disjoint masks */ - return MERGE_HANDLE; -} -#endif - /*********************************************************************** * merge_events * @@ -338,25 +296,6 @@ static enum event_merge_action merge_events( XEvent *prev, XEvent *next ) return MERGE_DISCARD; } break; -#ifdef HAVE_X11_EXTENSIONS_XINPUT2_H - case GenericEvent: - if (next->xcookie.extension != xinput2_opcode) break; - if (next->xcookie.evtype != XI_RawMotion) break; - if (x11drv_thread_data()->warp_serial) break; - return MERGE_KEEP; - } - break; - case GenericEvent: - if (prev->xcookie.extension != xinput2_opcode) break; - if (prev->xcookie.evtype != XI_RawMotion) break; - switch (next->type) - { - case GenericEvent: - if (next->xcookie.extension != xinput2_opcode) break; - if (next->xcookie.evtype != XI_RawMotion) break; - if (x11drv_thread_data()->warp_serial) break; - return merge_raw_motion_events( prev->xcookie.data, next->xcookie.data ); -#endif } break; } @@ -784,6 +723,7 @@ static BOOL X11DRV_FocusIn( HWND hwnd, XEvent *xev ) /* ignore wm specific NotifyUngrab / NotifyGrab events w.r.t focus */ if (event->mode == NotifyGrab || event->mode == NotifyUngrab) return FALSE;
+ enable_xinput2(); xim_set_focus( hwnd, TRUE );
if (use_take_focus) return TRUE; @@ -807,6 +747,7 @@ static void focus_out( Display *display , HWND hwnd ) { if (xim_in_compose_mode()) return;
+ disable_xinput2(); x11drv_thread_data()->last_focus = hwnd; xim_set_focus( hwnd, FALSE );
diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c index 2ea007ab588..0b062167d9a 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c @@ -56,6 +56,7 @@ MAKE_FUNCPTR(XcursorLibraryLoadCursor); #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(cursor); +WINE_DECLARE_DEBUG_CHANNEL(rawinput);
/**********************************************************************/
@@ -120,6 +121,8 @@ static const UINT button_up_data[NB_BUTTONS] = XBUTTON2 };
+static unsigned int noraw_flags = 0; + XContext cursor_context = 0;
static RECT clip_rect; @@ -128,10 +131,8 @@ static Cursor create_cursor( HANDLE handle ); #ifdef HAVE_X11_EXTENSIONS_XINPUT2_H static BOOL xinput2_available; static BOOL broken_rawevents; +static int xinput2_opcode; #define MAKE_FUNCPTR(f) static typeof(f) * p##f -MAKE_FUNCPTR(XIGetClientPointer); -MAKE_FUNCPTR(XIFreeDeviceInfo); -MAKE_FUNCPTR(XIQueryDevice); MAKE_FUNCPTR(XIQueryVersion); MAKE_FUNCPTR(XISelectEvents); #undef MAKE_FUNCPTR @@ -224,121 +225,6 @@ void set_window_cursor( Window window, HCURSOR handle ) XFlush( gdi_display ); }
-#ifdef HAVE_X11_EXTENSIONS_XINPUT2_H -/*********************************************************************** - * update_relative_valuators - */ -static void update_relative_valuators(XIAnyClassInfo **valuators, int n_valuators) -{ - struct x11drv_thread_data *thread_data = x11drv_thread_data(); - int i; - - thread_data->x_valuator.number = -1; - thread_data->y_valuator.number = -1; - - for (i = 0; i < n_valuators; i++) - { - XIValuatorClassInfo *class = (XIValuatorClassInfo *)valuators[i]; - if (valuators[i]->type != XIValuatorClass) continue; - if (class->label == x11drv_atom( Rel_X ) || - (!class->label && class->number == 0 && class->mode == XIModeRelative)) - thread_data->x_valuator = *class; - else if (class->label == x11drv_atom( Rel_Y ) || - (!class->label && class->number == 1 && class->mode == XIModeRelative)) - thread_data->y_valuator = *class; - } - - thread_data->x_valuator.value = 0; - thread_data->y_valuator.value = 0; -} - - -/*********************************************************************** - * enable_xinput2 - */ -static void enable_xinput2(void) -{ - struct x11drv_thread_data *data = x11drv_thread_data(); - XIEventMask mask; - XIDeviceInfo *pointer_info; - unsigned char mask_bits[XIMaskLen(XI_LASTEVENT)]; - int count; - - if (!xinput2_available) return; - - if (data->xi2_state == xi_unknown) - { - int major = 2, minor = 0; - if (!pXIQueryVersion( data->display, &major, &minor )) data->xi2_state = xi_disabled; - else - { - data->xi2_state = xi_unavailable; - WARN( "X Input 2 not available\n" ); - } - } - if (data->xi2_state == xi_unavailable) return; - if (!pXIGetClientPointer( data->display, None, &data->xi2_core_pointer )) return; - - mask.mask = mask_bits; - mask.mask_len = sizeof(mask_bits); - mask.deviceid = XIAllDevices; - memset( mask_bits, 0, sizeof(mask_bits) ); - XISetMask( mask_bits, XI_DeviceChanged ); - XISetMask( mask_bits, XI_RawMotion ); - XISetMask( mask_bits, XI_ButtonPress ); - - pXISelectEvents( data->display, DefaultRootWindow( data->display ), &mask, 1 ); - - pointer_info = pXIQueryDevice( data->display, data->xi2_core_pointer, &count ); - update_relative_valuators( pointer_info->classes, pointer_info->num_classes ); - pXIFreeDeviceInfo( pointer_info ); - - /* This device info list is only used to find the initial current slave if - * no XI_DeviceChanged events happened. If any hierarchy change occurred that - * might be relevant here (eg. user switching mice after (un)plugging), a - * XI_DeviceChanged event will point us to the right slave. So this list is - * safe to be obtained statically at enable_xinput2() time. - */ - if (data->xi2_devices) pXIFreeDeviceInfo( data->xi2_devices ); - data->xi2_devices = pXIQueryDevice( data->display, XIAllDevices, &data->xi2_device_count ); - data->xi2_current_slave = 0; - - data->xi2_state = xi_enabled; -} - -#endif - -/*********************************************************************** - * disable_xinput2 - */ -static void disable_xinput2(void) -{ -#ifdef HAVE_X11_EXTENSIONS_XINPUT2_H - struct x11drv_thread_data *data = x11drv_thread_data(); - XIEventMask mask; - - if (data->xi2_state != xi_enabled) return; - - TRACE( "disabling\n" ); - data->xi2_state = xi_disabled; - - mask.mask = NULL; - mask.mask_len = 0; - mask.deviceid = XIAllDevices; - - pXISelectEvents( data->display, DefaultRootWindow( data->display ), &mask, 1 ); - pXIFreeDeviceInfo( data->xi2_devices ); - data->x_valuator.number = -1; - data->y_valuator.number = -1; - data->x_valuator.value = 0; - data->y_valuator.value = 0; - data->xi2_devices = NULL; - data->xi2_core_pointer = 0; - data->xi2_current_slave = 0; -#endif -} - - /*********************************************************************** * grab_clipping_window * @@ -346,7 +232,6 @@ static void disable_xinput2(void) */ static BOOL grab_clipping_window( const RECT *clip ) { -#ifdef HAVE_X11_EXTENSIONS_XINPUT2_H struct x11drv_thread_data *data = x11drv_thread_data(); Window clip_window; HCURSOR cursor; @@ -360,22 +245,11 @@ static BOOL grab_clipping_window( const RECT *clip ) if (!data) return FALSE; if (!(clip_window = init_clip_window())) return TRUE;
- if (keyboard_grabbed) - { + if (keyboard_grabbed) { WARN( "refusing to clip to %s\n", wine_dbgstr_rect(clip) ); return FALSE; }
- /* enable XInput2 unless we are already clipping */ - if (!data->clipping_cursor) enable_xinput2(); - - if (data->xi2_state != xi_enabled) - { - WARN( "XInput2 not supported, refusing to clip to %s\n", wine_dbgstr_rect(clip) ); - NtUserClipCursor( NULL ); - return TRUE; - } - TRACE( "clipping to %s win %lx\n", wine_dbgstr_rect(clip), clip_window );
if (!data->clipping_cursor) XUnmapWindow( data->display, clip_window ); @@ -405,18 +279,12 @@ static BOOL grab_clipping_window( const RECT *clip )
set_window_cursor( clip_window, cursor );
- if (!clipping_cursor) - { - disable_xinput2(); + if (!clipping_cursor) { return FALSE; } clip_rect = *clip; data->clipping_cursor = TRUE; return TRUE; -#else - WARN( "XInput2 was not available at compile time\n" ); - return FALSE; -#endif }
/*********************************************************************** @@ -436,7 +304,6 @@ void ungrab_clipping_window(void) if (clipping_cursor) XUngrabPointer( data->display, CurrentTime ); clipping_cursor = FALSE; data->clipping_cursor = FALSE; - disable_xinput2(); }
/*********************************************************************** @@ -528,7 +395,7 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU { struct x11drv_thread_data *thread_data = x11drv_thread_data(); if (!thread_data->clipping_cursor || thread_data->clip_window != window) return; - __wine_send_input( hwnd, input, NULL, 0 ); + __wine_send_input( hwnd, input, NULL, noraw_flags ); return; }
@@ -555,7 +422,7 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU SERVER_END_REQ; }
- __wine_send_input( hwnd, input, NULL, 0 ); + __wine_send_input( hwnd, input, NULL, noraw_flags ); }
#ifdef SONAME_LIBXCURSOR @@ -1498,7 +1365,7 @@ void move_resize_window( HWND hwnd, int dir ) input.mi.dwFlags = button_up_flags[button - 1] | MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE; input.mi.time = NtGetTickCount(); input.mi.dwExtraInfo = 0; - __wine_send_input( hwnd, &input, NULL, 0 ); + __wine_send_input( hwnd, &input, NULL, noraw_flags ); }
while (NtUserPeekMessage( &msg, 0, 0, 0, PM_REMOVE )) @@ -1634,133 +1501,163 @@ BOOL X11DRV_EnterNotify( HWND hwnd, XEvent *xev ) }
#ifdef HAVE_X11_EXTENSIONS_XINPUT2_H - /*********************************************************************** - * X11DRV_DeviceChanged + * X11DRV_RawMotion */ -static BOOL X11DRV_DeviceChanged( XGenericEventCookie *xev ) -{ - XIDeviceChangedEvent *event = xev->data; - struct x11drv_thread_data *data = x11drv_thread_data(); - - if (event->deviceid != data->xi2_core_pointer) return FALSE; - if (event->reason != XISlaveSwitch) return FALSE; - - update_relative_valuators( event->classes, event->num_classes ); - data->xi2_current_slave = event->sourceid; - return TRUE; -} - -static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input ) +static BOOL X11DRV_RawMotion( XGenericEventCookie *xev ) { - struct x11drv_thread_data *thread_data = x11drv_thread_data(); - XIValuatorClassInfo *x = &thread_data->x_valuator, *y = &thread_data->y_valuator; - double x_value = 0, y_value = 0, x_scale, y_scale; - const double *values = event->valuators.values; - RECT virtual_rect; + XIRawEvent *event = xev->data; + const double *values = event->raw_values; + RAWINPUT rawinput; + INPUT input; int i;
- if (x->number < 0 || y->number < 0) return FALSE; - if (!event->valuators.mask_len) return FALSE; - if (thread_data->xi2_state != xi_enabled) return FALSE; - - /* If there is no slave currently detected, no previous motion nor device - * change events were received. Look it up now on the device list in this - * case. + /* Any mouse motion on any X11 window will generate xinput2 events to *all* + * X11 windows. If focus is not a good way to determine if a thread wants + * to get raw input events then we can make xinput2 always-on and filter + * out the noisy events: + * if (thread_data->xi2_state != xi2_enabled) return FALSE; */ - if (!thread_data->xi2_current_slave) - { - XIDeviceInfo *devices = thread_data->xi2_devices;
- for (i = 0; i < thread_data->xi2_device_count; i++) - { - if (devices[i].use != XISlavePointer) continue; - if (devices[i].deviceid != event->deviceid) continue; - if (devices[i].attachment != thread_data->xi2_core_pointer) continue; - thread_data->xi2_current_slave = event->deviceid; - break; - } + if (broken_rawevents && is_old_motion_event( xev->serial )) + { + TRACE( "old serial %lu, ignoring\n", xev->serial ); + return FALSE; } - if (event->deviceid != thread_data->xi2_current_slave) return FALSE;
- virtual_rect = NtUserGetVirtualScreenRect(); + rawinput.data.mouse.lLastX = 0; + rawinput.data.mouse.lLastY = 0;
- if (x->max <= x->min) x_scale = 1; - else x_scale = (virtual_rect.right - virtual_rect.left) / (x->max - x->min); - if (y->max <= y->min) y_scale = 1; - else y_scale = (virtual_rect.bottom - virtual_rect.top) / (y->max - y->min); - - for (i = 0; i <= max( x->number, y->number ); i++) + /* it would be better to parse these, but X and Y are always 0 and 1, + * respectively. */ + for (i = 0; i < 2; i++) { - if (!XIMaskIsSet( event->valuators.mask, i )) continue; - if (i == x->number) - { - x_value = *values; - x->value += x_value * x_scale; - } - if (i == y->number) - { - y_value = *values; - y->value += y_value * y_scale; + if (XIMaskIsSet( event->valuators.mask, i )) { + if (i == 0) { + rawinput.data.mouse.lLastX = *values; + } else if (i == 1) { + rawinput.data.mouse.lLastY = *values; + } } values++; }
- input->mi.dx = round( x->value ); - input->mi.dy = round( y->value ); + /* ignore scroll events for now */ + if (rawinput.data.mouse.lLastX == 0 && + rawinput.data.mouse.lLastY == 0) return FALSE;
- TRACE( "event %f,%f value %f,%f input %d,%d\n", x_value, y_value, x->value, y->value, - (int)input->mi.dx, (int)input->mi.dy ); + input.type = INPUT_HARDWARE; + input.hi.uMsg = WM_INPUT; + input.hi.wParamH = 0; + input.hi.wParamL = 0;
- x->value -= input->mi.dx; - y->value -= input->mi.dy; + rawinput.header.dwType = RIM_TYPEMOUSE; + rawinput.header.dwSize = offsetof(RAWINPUT, data) + sizeof(RAWMOUSE); + rawinput.header.hDevice = ULongToHandle(1); /* WINE_MOUSE_HANDLE */ + rawinput.header.wParam = RIM_INPUT; + rawinput.data.mouse.usFlags = MOUSEEVENTF_MOVE; + rawinput.data.mouse.ulRawButtons = 0; + rawinput.data.mouse.usButtonData = 0; + rawinput.data.mouse.usButtonFlags = 0; + rawinput.data.mouse.ulExtraInformation = 0;
- if (!input->mi.dx && !input->mi.dy) - { - TRACE( "accumulating motion\n" ); - return FALSE; - } + TRACE_(rawinput)("sending raw input x=%d y=%d\n", + (int)rawinput.data.mouse.lLastX, (int)rawinput.data.mouse.lLastY); + + __wine_send_input( 0, &input, &rawinput, 0 );
return TRUE; } +#endif /* HAVE_X11_EXTENSIONS_XINPUT2_H */
/*********************************************************************** - * X11DRV_RawMotion + * enable_xinput2 */ -static BOOL X11DRV_RawMotion( XGenericEventCookie *xev ) +void enable_xinput2(void) { - XIRawEvent *event = xev->data; - INPUT input; +#ifdef HAVE_X11_EXTENSIONS_XINPUT2_H + struct x11drv_thread_data *data = x11drv_thread_data(); + XIEventMask mask;
- if (broken_rawevents && is_old_motion_event( xev->serial )) - { - TRACE( "old serial %lu, ignoring\n", xev->serial ); - return FALSE; - } + if (!data) return; + if (!xinput2_available) return; + if (data->xi2_state == xi_enabled) return;
- input.type = INPUT_MOUSE; - input.mi.mouseData = 0; - input.mi.dwFlags = MOUSEEVENTF_MOVE; - input.mi.time = EVENT_x11_time_to_win32_time( event->time ); - input.mi.dwExtraInfo = 0; - input.mi.dx = 0; - input.mi.dy = 0; - if (!map_raw_event_coords( event, &input )) return FALSE; + mask.deviceid = XIMasterPointer; + mask.mask_len = XIMaskLen(XI_LASTEVENT); + mask.mask = calloc(mask.mask_len, sizeof(char));
- __wine_send_input( 0, &input, NULL, 0 ); - return TRUE; + XISetMask(mask.mask, XI_RawMotion); + + pXISelectEvents(data->display, DefaultRootWindow( data->display ), &mask, 1); + + free(mask.mask); + + data->xi2_state = xi_enabled; + TRACE("xinput2 enabled"); +#endif }
-#endif /* HAVE_X11_EXTENSIONS_XINPUT2_H */ +/*********************************************************************** + * disable_xinput2 + */ +void disable_xinput2(void) +{ +#ifdef HAVE_X11_EXTENSIONS_XINPUT2_H + struct x11drv_thread_data *data = x11drv_thread_data(); + XIEventMask mask; + + if (!data) return; + if (data->xi2_state != xi_enabled) return; + + mask.deviceid = XIMasterPointer; + mask.mask = NULL; + mask.mask_len = 0; + + pXISelectEvents( data->display, DefaultRootWindow( data->display ), &mask, 1 ); + + data->xi2_state = xi_disabled; + TRACE("xinput2 disabled"); +#endif +} + +/*********************************************************************** + * X11DRV_GenericEvent + */ +BOOL X11DRV_GenericEvent( HWND hwnd, XEvent *xev ) +{ + BOOL ret = FALSE; + XGenericEventCookie *event = &xev->xcookie; + + if (!event->data) return FALSE; +#ifdef HAVE_X11_EXTENSIONS_XINPUT2_H + if (event->extension != xinput2_opcode) return FALSE; +#endif
+ switch (event->evtype) + { +#ifdef HAVE_X11_EXTENSIONS_XINPUT2_H + case XI_RawMotion: + ret = X11DRV_RawMotion( event ); + break; +#endif + + default: + TRACE( "Unhandled event %#x\n", event->evtype ); + break; + } + return ret; +}
/*********************************************************************** * X11DRV_XInput2_Init */ void X11DRV_XInput2_Init(void) { -#if defined(SONAME_LIBXI) && defined(HAVE_X11_EXTENSIONS_XINPUT2_H) +#ifdef HAVE_X11_EXTENSIONS_XINPUT2_H int event, error; + int xi2maj = 2, xi2min = 1; +#ifdef SONAME_LIBXI void *libxi_handle = dlopen( SONAME_LIBXI, RTLD_NOW );
if (!libxi_handle) @@ -1768,58 +1665,40 @@ void X11DRV_XInput2_Init(void) WARN( "couldn't load %s\n", SONAME_LIBXI ); return; } + #define LOAD_FUNCPTR(f) \ if (!(p##f = dlsym( libxi_handle, #f))) \ { \ WARN("Failed to load %s.\n", #f); \ return; \ } - - LOAD_FUNCPTR(XIGetClientPointer); - LOAD_FUNCPTR(XIFreeDeviceInfo); - LOAD_FUNCPTR(XIQueryDevice); LOAD_FUNCPTR(XIQueryVersion); LOAD_FUNCPTR(XISelectEvents); #undef LOAD_FUNCPTR +#endif
- xinput2_available = XQueryExtension( gdi_display, "XInputExtension", &xinput2_opcode, &event, &error ); + if (FALSE == XQueryExtension( gdi_display, "XInputExtension", &xinput2_opcode, &event, &error )) + { + WARN( "X server missing XInputExtension, cannot use XInput2\n" ); + return; + }
/* Until version 1.10.4 rawinput was broken in XOrg, see * https://bugs.freedesktop.org/show_bug.cgi?id=30068 */ broken_rawevents = strstr(XServerVendor( gdi_display ), "X.Org") && XVendorRelease( gdi_display ) < 11004000;
-#else - TRACE( "X Input 2 support not compiled in.\n" ); -#endif -} - - -/*********************************************************************** - * X11DRV_GenericEvent - */ -BOOL X11DRV_GenericEvent( HWND hwnd, XEvent *xev ) -{ - BOOL ret = FALSE; -#ifdef HAVE_X11_EXTENSIONS_XINPUT2_H - XGenericEventCookie *event = &xev->xcookie; - - if (!event->data) return FALSE; - if (event->extension != xinput2_opcode) return FALSE; - - switch (event->evtype) + if (Success == pXIQueryVersion( gdi_display, &xi2maj, &xi2min )) { - case XI_DeviceChanged: - ret = X11DRV_DeviceChanged( event ); - break; - case XI_RawMotion: - ret = X11DRV_RawMotion( event ); - break; - - default: - TRACE( "Unhandled event %#x\n", event->evtype ); - break; + TRACE("XInput2 version %d.%d detected\n", xi2maj, xi2min); + xinput2_available = TRUE; + noraw_flags = MOUSEEVENTF_MOVE; + } + else + { + WARN( "XInput2 >= 2.1 not found\n" ); } +#else + TRACE( "XInput2 support not compiled in.\n" ); #endif - return ret; } diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 2c15a95dfab..5535f6d52d8 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -262,6 +262,8 @@ extern void X11DRV_ThreadDetach(void) DECLSPEC_HIDDEN;
extern void X11DRV_Xcursor_Init(void) DECLSPEC_HIDDEN; extern void X11DRV_XInput2_Init(void) DECLSPEC_HIDDEN; +extern void enable_xinput2(void) DECLSPEC_HIDDEN; +extern void disable_xinput2(void) DECLSPEC_HIDDEN;
extern DWORD copy_image_bits( BITMAPINFO *info, BOOL is_r8g8b8, XImage *image, const struct gdi_image_bits *src_bits, struct gdi_image_bits *dst_bits, @@ -391,13 +393,7 @@ struct x11drv_thread_data Window clip_window; /* window used for cursor clipping */ BOOL clipping_cursor; /* whether thread is currently clipping the cursor */ #ifdef HAVE_X11_EXTENSIONS_XINPUT2_H - enum { xi_unavailable = -1, xi_unknown, xi_disabled, xi_enabled } xi2_state; /* XInput2 state */ - void *xi2_devices; /* list of XInput2 devices (valid when state is enabled) */ - int xi2_device_count; - XIValuatorClassInfo x_valuator; - XIValuatorClassInfo y_valuator; - int xi2_core_pointer; /* XInput2 core pointer id */ - int xi2_current_slave; /* Current slave driving the Core pointer */ + enum { xi_disabled, xi_enabled } xi2_state; /* XInput2 state */ #endif /* HAVE_X11_EXTENSIONS_XINPUT2_H */ };
@@ -575,7 +571,6 @@ extern BOOL X11DRV_SelectionClear( HWND hWnd, XEvent *event ) DECLSPEC_HIDDEN; extern BOOL X11DRV_MappingNotify( HWND hWnd, XEvent *event ) DECLSPEC_HIDDEN; extern BOOL X11DRV_GenericEvent( HWND hwnd, XEvent *event ) DECLSPEC_HIDDEN;
-extern int xinput2_opcode DECLSPEC_HIDDEN; extern Bool (*pXGetEventData)( Display *display, XEvent /*XGenericEventCookie*/ *event ) DECLSPEC_HIDDEN; extern void (*pXFreeEventData)( Display *display, XEvent /*XGenericEventCookie*/ *event ) DECLSPEC_HIDDEN;