diff options
-rw-r--r-- | dix/devices.c | 6 | ||||
-rw-r--r-- | dix/events.c | 6 | ||||
-rw-r--r-- | dix/getevents.c | 30 | ||||
-rw-r--r-- | hw/dmx/config/xdmxconfig.c | 3 | ||||
-rw-r--r-- | xfixes/xfixes.c | 2 | ||||
-rw-r--r-- | xkb/xkbAccessX.c | 30 |
6 files changed, 56 insertions, 21 deletions
diff --git a/dix/devices.c b/dix/devices.c index fd4916a3a..7d7888ea1 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -514,6 +514,12 @@ DisableAllDevices(void) { DeviceIntPtr dev, tmp; + /* Disable slave devices first, excluding XTest devices */ + nt_list_for_each_entry_safe(dev, tmp, inputInfo.devices, next) { + if (!IsXTestDevice(dev, NULL) && !IsMaster(dev)) + DisableDevice(dev, FALSE); + } + /* Disable XTest devices */ nt_list_for_each_entry_safe(dev, tmp, inputInfo.devices, next) { if (!IsMaster(dev)) DisableDevice(dev, FALSE); diff --git a/dix/events.c b/dix/events.c index 904f0ba87..a43c99ac9 100644 --- a/dix/events.c +++ b/dix/events.c @@ -4561,6 +4561,7 @@ DeviceEnterLeaveEvent(DeviceIntPtr mouse, { GrabPtr grab = mouse->deviceGrab.grab; xXIEnterEvent *event; + WindowPtr focus; int filter; int btlen, len, i; DeviceIntPtr kbd; @@ -4602,6 +4603,11 @@ DeviceEnterLeaveEvent(DeviceIntPtr mouse, event->group.locked_group = kbd->key->xkbInfo->state.locked_group; } + focus = (kbd) ? kbd->focus->win : None; + if ((focus != NoneWin) && + ((pWin == focus) || (focus == PointerRootWin) || IsParent(focus, pWin))) + event->focus = TRUE; + FixUpEventFromWindow(mouse->spriteInfo->sprite, (xEvent *) event, pWin, None, FALSE); diff --git a/dix/getevents.c b/dix/getevents.c index 241fcfd69..707678352 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -787,11 +787,33 @@ add_to_scroll_valuator(DeviceIntPtr dev, ValuatorMask *mask, int valuator, doubl * @param[in,out] mask Valuator data for this event, modified in-place. */ static void -moveRelative(DeviceIntPtr dev, ValuatorMask *mask) +moveRelative(DeviceIntPtr dev, int flags, ValuatorMask *mask) { int i; Bool clip_xy = IsMaster(dev) || !IsFloating(dev); + /* for abs devices in relative mode, we've just scaled wrong, since we + mapped the device's shape into the screen shape. Undo this. */ + if ((flags & POINTER_ABSOLUTE) == 0 && dev->valuator && + dev->valuator->axes[0].min_value < dev->valuator->axes[0].max_value) { + + double ratio = 1.0 * screenInfo.width/screenInfo.height; + + if (ratio > 1.0) { + double y; + if (valuator_mask_fetch_double(mask, 1, &y)) { + y *= ratio; + valuator_mask_set_double(mask, 1, y); + } + } else { + double x; + if (valuator_mask_fetch_double(mask, 0, &x)) { + x *= ratio; + valuator_mask_set_double(mask, 0, x); + } + } + } + /* calc other axes, clip, drop back into valuators */ for (i = 0; i < valuator_mask_size(mask); i++) { double val = dev->last.valuators[i]; @@ -844,14 +866,14 @@ scale_from_screen(DeviceIntPtr dev, ValuatorMask *mask) scaled = valuator_mask_get_double(mask, 0) + scr->x; scaled = rescaleValuatorAxis(scaled, NULL, dev->valuator->axes + 0, - 0, scr->width); + screenInfo.x, screenInfo.width); valuator_mask_set_double(mask, 0, scaled); } if (valuator_mask_isset(mask, 1)) { scaled = valuator_mask_get_double(mask, 1) + scr->y; scaled = rescaleValuatorAxis(scaled, NULL, dev->valuator->axes + 1, - 0, scr->height); + screenInfo.y, screenInfo.height); valuator_mask_set_double(mask, 1, scaled); } } @@ -1387,7 +1409,7 @@ fill_pointer_events(InternalEvent *events, DeviceIntPtr pDev, int type, if ((flags & POINTER_NORAW) == 0) set_raw_valuators(raw, &mask, raw->valuators.data); - moveRelative(pDev, &mask); + moveRelative(pDev, flags, &mask); } /* valuators are in device coordinate system in absolute coordinates */ diff --git a/hw/dmx/config/xdmxconfig.c b/hw/dmx/config/xdmxconfig.c index f30841244..2121dd781 100644 --- a/hw/dmx/config/xdmxconfig.c +++ b/hw/dmx/config/xdmxconfig.c @@ -31,9 +31,6 @@ * */ -#ifdef HAVE_DMX_CONFIG_H -#include <dmx-config.h> -#endif #include <stdio.h> #include <stdlib.h> diff --git a/xfixes/xfixes.c b/xfixes/xfixes.c index 52c57dfab..48af9ea6e 100644 --- a/xfixes/xfixes.c +++ b/xfixes/xfixes.c @@ -74,7 +74,7 @@ ProcXFixesQueryVersion(ClientPtr client) if (version_compare(stuff->majorVersion, stuff->minorVersion, SERVER_XFIXES_MAJOR_VERSION, - SERVER_XFIXES_MAJOR_VERSION) < 0) { + SERVER_XFIXES_MINOR_VERSION) < 0) { rep.majorVersion = stuff->majorVersion; rep.minorVersion = stuff->minorVersion; } diff --git a/xkb/xkbAccessX.c b/xkb/xkbAccessX.c index 21df85d94..13051e034 100644 --- a/xkb/xkbAccessX.c +++ b/xkb/xkbAccessX.c @@ -723,23 +723,27 @@ ProcessPointerEvent(InternalEvent *ev, DeviceIntPtr mouse) changed |= XkbPointerButtonMask; } else if (event->type == ET_ButtonRelease) { - if (xkbi) { - xkbi->lockedPtrButtons &= ~(1 << (event->detail.key & 0x7)); - - if (IsMaster(dev)) { - DeviceIntPtr source; - int rc; - - rc = dixLookupDevice(&source, event->sourceid, serverClient, - DixWriteAccess); - if (rc != Success) - ErrorF("[xkb] bad sourceid '%d' on button release event.\n", - event->sourceid); - else if (!IsXTestDevice(source, GetMaster(dev, MASTER_POINTER))) + if (IsMaster(dev)) { + DeviceIntPtr source; + int rc; + + rc = dixLookupDevice(&source, event->sourceid, serverClient, + DixWriteAccess); + if (rc != Success) + ErrorF("[xkb] bad sourceid '%d' on button release event.\n", + event->sourceid); + else if (!IsXTestDevice(source, GetMaster(dev, MASTER_POINTER))) { + DeviceIntPtr xtest_device; + + xtest_device = GetXTestDevice(GetMaster(dev, MASTER_POINTER)); + if (button_is_down(xtest_device, ev->device_event.detail.button, BUTTON_PROCESSED)) XkbFakeDeviceButton(dev, FALSE, event->detail.key); } } + if (xkbi) + xkbi->lockedPtrButtons &= ~(1 << (event->detail.key & 0x7)); + changed |= XkbPointerButtonMask; } |