diff options
Diffstat (limited to 'hw/xfree86/common/xf86Xinput.c')
-rw-r--r-- | hw/xfree86/common/xf86Xinput.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index 16e330d43..17ffed899 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -90,6 +90,10 @@ #include "mi.h" +#ifdef XFreeXDGA +#include "dgaproc.h" +#endif + xEvent *xf86Events = NULL; static Bool @@ -128,6 +132,9 @@ xf86ProcessCommonOptions(LocalDevicePtr local, } else { xf86Msg(X_CONFIG, "%s: doesn't report drag events\n", local->name); } + + /* Backwards compatibility. */ + local->history_size = GetMotionHistorySize(); } /*********************************************************************** @@ -395,10 +402,12 @@ xf86PostMotionEvent(DeviceIntPtr device, { va_list var; int i = 0, nevents = 0; + int dx, dy; Bool drag = xf86SendDragEvents(device); int *valuators = NULL; int flags = 0; xEvent *xE = NULL; + int index; if (is_absolute) flags = POINTER_ABSOLUTE; @@ -412,6 +421,24 @@ xf86PostMotionEvent(DeviceIntPtr device, valuators[i] = va_arg(var, int); va_end(var); +#if XFreeXDGA + if (first_valuator == 0 && num_valuators >= 2) { + if (miPointerGetScreen(inputInfo.pointer)) { + index = miPointerGetScreen(inputInfo.pointer)->myNum; + if (is_absolute) { + dx = valuators[0] - device->valuator->lastx; + dy = valuators[1] - device->valuator->lasty; + } + else { + dx = valuators[0]; + dy = valuators[1]; + } + if (DGAStealMotionEvent(index, dx, dy)) + goto out; + } + } +#endif + if (!xf86Events) xf86Events = (xEvent *)xcalloc(sizeof(xEvent), GetMaximumEventsNum()); if (!xf86Events) @@ -430,6 +457,7 @@ xf86PostMotionEvent(DeviceIntPtr device, } } +out: xfree(valuators); } @@ -476,6 +504,15 @@ xf86PostButtonEvent(DeviceIntPtr device, va_list var; int *valuators = NULL; int i = 0, nevents = 0; + int index; + +#if XFreeXDGA + if (miPointerGetScreen(inputInfo.pointer)) { + index = miPointerGetScreen(inputInfo.pointer)->myNum; + if (DGAStealButtonEvent(index, button, is_down)) + return; + } +#endif valuators = xcalloc(sizeof(int), num_valuators); @@ -552,6 +589,15 @@ xf86PostKeyboardEvent(DeviceIntPtr device, int is_down) { int nevents = 0, i = 0; + int index; + +#if XFreeXDGA + if (miPointerGetScreen(inputInfo.pointer)) { + index = miPointerGetScreen(inputInfo.pointer)->myNum; + if (DGAStealKeyEvent(index, key_code, is_down)) + return; + } +#endif if (!xf86Events) xf86Events = (xEvent *)xcalloc(sizeof(xEvent), GetMaximumEventsNum()); |