From 90b177e5cbb9047453af426d2abfe9c0514fe866 Mon Sep 17 00:00:00 2001 From: Thomas Jaeger Date: Sat, 13 Oct 2012 22:43:26 -0400 Subject: Update the MD's position when a touch event is received Signed-off-by: Thomas Jaeger Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer --- dix/getevents.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dix/getevents.c b/dix/getevents.c index 2a686e877..5c1e97ef4 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -1994,6 +1994,14 @@ GetTouchEvents(InternalEvent *events, DeviceIntPtr dev, uint32_t ddx_touchid, if (emulate_pointer) storeLastValuators(dev, &mask, 0, 1, devx, devy); + /* Update the MD's co-ordinates, which are always in desktop space. */ + if (emulate_pointer && !IsMaster(dev) && !IsFloating(dev)) { + DeviceIntPtr master = GetMaster(dev, MASTER_POINTER); + + master->last.valuators[0] = screenx; + master->last.valuators[1] = screeny; + } + event->root = scr->root->drawable.id; event_set_root_coordinates(event, screenx, screeny); -- cgit v1.2.3 From cc79107a5b60d2926e16ddbee04149e8d5acc969 Mon Sep 17 00:00:00 2001 From: Thomas Jaeger Date: Sat, 13 Oct 2012 22:51:24 -0400 Subject: Don't use GetTouchEvents when replaying events GetTouchEvents has plenty of side effects such as moving the pointer or updating the master device, which we don't want to happen when replaying. The only reason for calling it was to generate a DCCE event, but GetTouchEvents doesn't even do that right (we might need a DCCE event even when replaying a master event, or clients could interpret valuator data incorrectly). This discussion is moot at the moment anyway, since DeliverTouchEvents doesn't appear to deliver DCCE events. Signed-off-by: Thomas Jaeger Reviewed-by: Peter Hutterer [Added call to processInputProc instead of direct call to DeliverTouchEvents] Signed-off-by: Peter Hutterer --- dix/touch.c | 61 +++++++++++++++++++++++++-------------------------------- include/input.h | 2 ++ 2 files changed, 29 insertions(+), 34 deletions(-) diff --git a/dix/touch.c b/dix/touch.c index 5f77be575..29ba17194 100644 --- a/dix/touch.c +++ b/dix/touch.c @@ -463,45 +463,14 @@ TouchEventHistoryPush(TouchPointInfoPtr ti, const DeviceEvent *ev) void TouchEventHistoryReplay(TouchPointInfoPtr ti, DeviceIntPtr dev, XID resource) { - InternalEvent *tel; - ValuatorMask *mask; - int i, nev; - int flags; + int i; if (!ti->history) return; - tel = InitEventList(GetMaximumEventsNum()); - mask = valuator_mask_new(0); - - valuator_mask_set_double(mask, 0, ti->history[0].valuators.data[0]); - valuator_mask_set_double(mask, 1, ti->history[0].valuators.data[1]); - - flags = TOUCH_CLIENT_ID | TOUCH_REPLAYING; - if (ti->emulate_pointer) - flags |= TOUCH_POINTER_EMULATED; - /* Generate events based on a fake touch begin event to get DCCE events if - * needed */ - /* FIXME: This needs to be cleaned up */ - nev = GetTouchEvents(tel, dev, ti->client_id, XI_TouchBegin, flags, mask); - for (i = 0; i < nev; i++) { - /* Send saved touch begin event */ - if (tel[i].any.type == ET_TouchBegin) { - DeviceEvent *ev = &ti->history[0]; - ev->flags |= TOUCH_REPLAYING; - DeliverTouchEvents(dev, ti, (InternalEvent*)ev, resource); - } - else {/* Send DCCE event */ - tel[i].any.time = ti->history[0].time; - DeliverTouchEvents(dev, ti, tel + i, resource); - } - } - - valuator_mask_free(&mask); - FreeEventList(tel, GetMaximumEventsNum()); + TouchDeliverDeviceClassesChangedEvent(ti, ti->history[0].time, resource); - /* First event was TouchBegin, already replayed that one */ - for (i = 1; i < ti->history_elements; i++) { + for (i = 0; i < ti->history_elements; i++) { DeviceEvent *ev = &ti->history[i]; ev->flags |= TOUCH_REPLAYING; @@ -509,6 +478,30 @@ TouchEventHistoryReplay(TouchPointInfoPtr ti, DeviceIntPtr dev, XID resource) } } +void +TouchDeliverDeviceClassesChangedEvent(TouchPointInfoPtr ti, Time time, + XID resource) +{ + DeviceIntPtr dev; + int num_events = 0; + InternalEvent dcce; + + dixLookupDevice(&dev, ti->sourceid, serverClient, DixWriteAccess); + + if (!dev) + return; + + /* UpdateFromMaster generates at most one event */ + UpdateFromMaster(&dcce, dev, DEVCHANGE_POINTER_EVENT, &num_events); + BUG_WARN(num_events > 1); + + if (num_events) { + dcce.any.time = time; + /* FIXME: This doesn't do anything */ + dev->public.processInputProc(&dcce, dev); + } +} + Bool TouchBuildDependentSpriteTrace(DeviceIntPtr dev, SpritePtr sprite) { diff --git a/include/input.h b/include/input.h index f8459b8c8..9522d00e9 100644 --- a/include/input.h +++ b/include/input.h @@ -580,6 +580,8 @@ extern int TouchListenerAcceptReject(DeviceIntPtr dev, TouchPointInfoPtr ti, extern int TouchAcceptReject(ClientPtr client, DeviceIntPtr dev, int mode, uint32_t touchid, Window grab_window, XID *error); extern void TouchEndPhysicallyActiveTouches(DeviceIntPtr dev); +extern void TouchDeliverDeviceClassesChangedEvent(TouchPointInfoPtr ti, + Time time, XID resource); /* misc event helpers */ extern Mask GetEventMask(DeviceIntPtr dev, xEvent *ev, InputClientsPtr clients); -- cgit v1.2.3 From fe59774c55e5d423633405e0869c22f4ce382548 Mon Sep 17 00:00:00 2001 From: Thomas Jaeger Date: Sat, 13 Oct 2012 23:08:27 -0400 Subject: Don't use GetTouchEvents in EmitTouchEnd As before GetTouchEvents causes unwanted side effects. Add a new function GetDixTouchEnd, which generates a touch event from the touch point. We fill in the event's screen coordinates from the MD's current sprite position. Signed-off-by: Thomas Jaeger Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer --- Xi/exevents.c | 18 ++++-------------- dix/getevents.c | 31 +++++++++++++++++++++++++++++++ include/input.h | 5 +++++ 3 files changed, 40 insertions(+), 14 deletions(-) diff --git a/Xi/exevents.c b/Xi/exevents.c index 4248b9a86..2caf98c25 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -1066,24 +1066,14 @@ ActivateEarlyAccept(DeviceIntPtr dev, TouchPointInfoPtr ti) static void EmitTouchEnd(DeviceIntPtr dev, TouchPointInfoPtr ti, int flags, XID resource) { - InternalEvent *tel = InitEventList(GetMaximumEventsNum()); - ValuatorMask *mask = valuator_mask_new(2); - int i, nev; - - valuator_mask_set_double(mask, 0, - valuator_mask_get_double(ti->valuators, 0)); - valuator_mask_set_double(mask, 1, - valuator_mask_get_double(ti->valuators, 1)); + InternalEvent event; flags |= TOUCH_CLIENT_ID; if (ti->emulate_pointer) flags |= TOUCH_POINTER_EMULATED; - nev = GetTouchEvents(tel, dev, ti->client_id, XI_TouchEnd, flags, mask); - for (i = 0; i < nev; i++) - DeliverTouchEvents(dev, ti, tel + i, resource); - - valuator_mask_free(&mask); - FreeEventList(tel, GetMaximumEventsNum()); + TouchDeliverDeviceClassesChangedEvent(ti, GetTimeInMillis(), resource); + GetDixTouchEnd(&event, dev, ti, flags); + DeliverTouchEvents(dev, ti, &event, resource); } /** diff --git a/dix/getevents.c b/dix/getevents.c index 5c1e97ef4..39b0821f6 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -2022,6 +2022,37 @@ GetTouchEvents(InternalEvent *events, DeviceIntPtr dev, uint32_t ddx_touchid, return num_events; } +void +GetDixTouchEnd(InternalEvent *ievent, DeviceIntPtr dev, TouchPointInfoPtr ti, + uint32_t flags) +{ + ScreenPtr scr = dev->spriteInfo->sprite->hotPhys.pScreen; + DeviceEvent *event = &ievent->device_event; + CARD32 ms = GetTimeInMillis(); + + BUG_WARN(!dev->enabled); + + init_device_event(event, dev, ms); + + event->sourceid = ti->sourceid; + event->type = ET_TouchEnd; + + event->root = scr->root->drawable.id; + + /* Get screen event coordinates from the sprite. Is this really the best + * we can do? */ + event_set_root_coordinates(event, + dev->last.valuators[0], + dev->last.valuators[1]); + event->touchid = ti->client_id; + event->flags = flags; + + if (flags & TOUCH_POINTER_EMULATED) { + event->flags |= TOUCH_POINTER_EMULATED; + event->detail.button = 1; + } +} + /** * Synthesize a single motion event for the core pointer. * diff --git a/include/input.h b/include/input.h index 9522d00e9..2387dbf4a 100644 --- a/include/input.h +++ b/include/input.h @@ -465,6 +465,11 @@ extern int GetTouchOwnershipEvents(InternalEvent *events, TouchPointInfoPtr ti, uint8_t mode, XID resource, uint32_t flags); +extern void GetDixTouchEnd(InternalEvent *ievent, + DeviceIntPtr dev, + TouchPointInfoPtr ti, + uint32_t flags); + extern _X_EXPORT int GetProximityEvents(InternalEvent *events, DeviceIntPtr pDev, int type, const ValuatorMask *mask); -- cgit v1.2.3 From d0fd592fc7be1706084923f43fa057e50122562c Mon Sep 17 00:00:00 2001 From: Thomas Jaeger Date: Sat, 13 Oct 2012 23:18:50 -0400 Subject: Simplify GetTouchEvents With only one callee left, we are free to assume that !(flags & TOUCH_CLIENT_ID) Signed-off-by: Thomas Jaeger Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer --- dix/getevents.c | 66 +++++++++++++++------------------------------------------ 1 file changed, 17 insertions(+), 49 deletions(-) diff --git a/dix/getevents.c b/dix/getevents.c index 39b0821f6..9fc8047bd 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -1833,10 +1833,7 @@ GetTouchEvents(InternalEvent *events, DeviceIntPtr dev, uint32_t ddx_touchid, int i; int num_events = 0; RawDeviceEvent *raw; - union touch { - TouchPointInfoPtr dix_ti; - DDXTouchPointInfoPtr ti; - } touchpoint; + DDXTouchPointInfoPtr ti; int need_rawevent = TRUE; Bool emulate_pointer = FALSE; int client_id = 0; @@ -1855,37 +1852,15 @@ GetTouchEvents(InternalEvent *events, DeviceIntPtr dev, uint32_t ddx_touchid, /* Find and/or create the DDX touch info */ - if (flags & TOUCH_CLIENT_ID) { /* A DIX-submitted TouchEnd */ - touchpoint.dix_ti = TouchFindByClientID(dev, ddx_touchid); - BUG_RETURN_VAL(!touchpoint.dix_ti, 0); - - if (!mask_in || - !valuator_mask_isset(mask_in, 0) || - !valuator_mask_isset(mask_in, 1)) { - ErrorF - ("[dix] dix-submitted events must have x/y valuator information.\n"); - return 0; - } - - need_rawevent = FALSE; - client_id = touchpoint.dix_ti->client_id; - } - else { /* a DDX-submitted touch */ - - touchpoint.ti = - TouchFindByDDXID(dev, ddx_touchid, (type == XI_TouchBegin)); - if (!touchpoint.ti) { - ErrorFSigSafe("[dix] %s: unable to %s touch point %u\n", dev->name, - type == XI_TouchBegin ? "begin" : "find", ddx_touchid); - return 0; - } - client_id = touchpoint.ti->client_id; + ti = TouchFindByDDXID(dev, ddx_touchid, (type == XI_TouchBegin)); + if (!ti) { + ErrorFSigSafe("[dix] %s: unable to %s touch point %u\n", dev->name, + type == XI_TouchBegin ? "begin" : "find", ddx_touchid); + return 0; } + client_id = ti->client_id; - if (!(flags & TOUCH_CLIENT_ID)) - emulate_pointer = touchpoint.ti->emulate_pointer; - else - emulate_pointer = ! !(flags & TOUCH_POINTER_EMULATED); + emulate_pointer = ti->emulate_pointer; if (!IsMaster(dev)) events = @@ -1905,11 +1880,6 @@ GetTouchEvents(InternalEvent *events, DeviceIntPtr dev, uint32_t ddx_touchid, num_events++; init_device_event(event, dev, ms); - /* if submitted for master device, get the sourceid from there */ - if (flags & TOUCH_CLIENT_ID) { - event->sourceid = touchpoint.dix_ti->sourceid; - /* TOUCH_CLIENT_ID implies norawevent */ - } switch (type) { case XI_TouchBegin: @@ -1934,20 +1904,20 @@ GetTouchEvents(InternalEvent *events, DeviceIntPtr dev, uint32_t ddx_touchid, event->type = ET_TouchEnd; /* We can end the DDX touch here, since we don't use the active * field below */ - if (!(flags & TOUCH_CLIENT_ID)) - TouchEndDDXTouch(dev, touchpoint.ti); + TouchEndDDXTouch(dev, ti); break; default: return 0; } - if (t->mode == XIDirectTouch && !(flags & TOUCH_CLIENT_ID)) { + + if (t->mode == XIDirectTouch) { if (!valuator_mask_isset(&mask, 0)) valuator_mask_set_double(&mask, 0, - valuator_mask_get_double(touchpoint.ti-> + valuator_mask_get_double(ti-> valuators, 0)); if (!valuator_mask_isset(&mask, 1)) valuator_mask_set_double(&mask, 1, - valuator_mask_get_double(touchpoint.ti-> + valuator_mask_get_double(ti-> valuators, 1)); } @@ -1957,13 +1927,11 @@ GetTouchEvents(InternalEvent *events, DeviceIntPtr dev, uint32_t ddx_touchid, if (t->mode == XIDirectTouch) { transformAbsolute(dev, &mask); - if (!(flags & TOUCH_CLIENT_ID)) { - for (i = 0; i < valuator_mask_size(&mask); i++) { - double val; + for (i = 0; i < valuator_mask_size(&mask); i++) { + double val; - if (valuator_mask_fetch_double(&mask, i, &val)) - valuator_mask_set_double(touchpoint.ti->valuators, i, val); - } + if (valuator_mask_fetch_double(&mask, i, &val)) + valuator_mask_set_double(ti->valuators, i, val); } clipAbsolute(dev, &mask); -- cgit v1.2.3 From 3b9f1c701787965246638c1a6fd99fb2b6078114 Mon Sep 17 00:00:00 2001 From: Yuly Novikov Date: Mon, 19 Nov 2012 21:04:57 -0500 Subject: dix: Save touchpoint last coordinates before transform. #49347 DDXTouchPointInfoRec.valuators used to store axis values after transform. This resulted in Coordinate Transformation Matrix being applied multiple times to the last coordinates, in the case when only pressure changes in the last touch event. Changed DDXTouchPointInfoRec.valuators to store values before transform. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=49347 Signed-off-by: Yuly Novikov Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer --- dix/getevents.c | 22 ++++++++-------------- include/inputstr.h | 2 +- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/dix/getevents.c b/dix/getevents.c index 9fc8047bd..fa538d9f4 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -1910,30 +1910,24 @@ GetTouchEvents(InternalEvent *events, DeviceIntPtr dev, uint32_t ddx_touchid, return 0; } - if (t->mode == XIDirectTouch) { - if (!valuator_mask_isset(&mask, 0)) - valuator_mask_set_double(&mask, 0, - valuator_mask_get_double(ti-> - valuators, 0)); - if (!valuator_mask_isset(&mask, 1)) - valuator_mask_set_double(&mask, 1, - valuator_mask_get_double(ti-> - valuators, 1)); - } - /* Get our screen event co-ordinates (root_x/root_y/event_x/event_y): * these come from the touchpoint in Absolute mode, or the sprite in * Relative. */ if (t->mode == XIDirectTouch) { - transformAbsolute(dev, &mask); - - for (i = 0; i < valuator_mask_size(&mask); i++) { + for (i = 0; i < max(valuator_mask_size(&mask), 2); i++) { double val; if (valuator_mask_fetch_double(&mask, i, &val)) valuator_mask_set_double(ti->valuators, i, val); + /* If the device doesn't post new X and Y axis values, + * use the last values posted. + */ + else if (i < 2 && + valuator_mask_fetch_double(ti->valuators, i, &val)) + valuator_mask_set_double(&mask, i, val); } + transformAbsolute(dev, &mask); clipAbsolute(dev, &mask); } else { diff --git a/include/inputstr.h b/include/inputstr.h index 5a38924de..bb0a77963 100644 --- a/include/inputstr.h +++ b/include/inputstr.h @@ -331,7 +331,7 @@ typedef struct _DDXTouchPointInfo { uint32_t ddx_id; /* touch ID given by the DDX */ Bool emulate_pointer; - ValuatorMask *valuators; /* last recorded axis values */ + ValuatorMask *valuators; /* last axis values as posted, pre-transform */ } DDXTouchPointInfoRec; typedef struct _TouchClassRec { -- cgit v1.2.3 From a51b2c3913fc8556f6bd1c76805d045fc424c4bb Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Tue, 20 Nov 2012 14:50:41 -0500 Subject: cursor: Revise edge cases for the pointer moving towards barriers Since barriers block the invisible line between pixels, that means that we need to explicitly check the boundaries, or else we'll have a potential off-by-one error. This fixes issues when trying to move down or right across a barrier and having the pointer visibly bounce. Signed-off-by: Jasper St. Pierre Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer --- xfixes/cursor.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/xfixes/cursor.c b/xfixes/cursor.c index bd175b40f..ffee4d6ab 100644 --- a/xfixes/cursor.c +++ b/xfixes/cursor.c @@ -1093,7 +1093,11 @@ barrier_is_blocking(const struct PointerBarrier * barrier, if (dir & BarrierNegativeX && x1 == (barrier->x1 - 1)) return FALSE; /* startpoint adjacent to barrier, moving towards -> block */ - if (x1 == barrier->x1 && y1 >= barrier->y1 && y1 <= barrier->y2) { + if (dir & BarrierPositiveX && x1 == (barrier->x1 - 1) && y1 >= barrier->y1 && y1 <= barrier->y2) { + *distance = 0; + return TRUE; + } + if (dir & BarrierNegativeX && x1 == barrier->x1 && y1 >= barrier->y1 && y1 <= barrier->y2) { *distance = 0; return TRUE; } @@ -1105,7 +1109,11 @@ barrier_is_blocking(const struct PointerBarrier * barrier, if (dir & BarrierNegativeY && y1 == (barrier->y1 - 1)) return FALSE; /* startpoint adjacent to barrier, moving towards -> block */ - if (y1 == barrier->y1 && x1 >= barrier->x1 && x1 <= barrier->x2) { + if (dir & BarrierPositiveY && y1 == (barrier->y1 - 1) && x1 >= barrier->x1 && x1 <= barrier->x2) { + *distance = 0; + return TRUE; + } + if (dir & BarrierNegativeY && y1 == barrier->y1 && x1 >= barrier->x1 && x1 <= barrier->x2) { *distance = 0; return TRUE; } -- cgit v1.2.3 From 2dc6d9228456cbc274a1fcea478258e5ae4dc629 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 15 Nov 2012 14:00:57 +1000 Subject: When resetting device idle time, reset XIAll(Master)Devices too (#56649) When the screen saver is forcibly deactivated, the idle time counter is reset for all devices but not for the fake XIAllDevices and XIAllMasterDevices. XScreenSaverQueryInfo uses XIAlldevices to fill the "idle" field, thus returning the wrong value. Regression introduced in commit 6aef209ebc2e54f5465da505a780f7b4cc273ee0 Author: Peter Hutterer Date: Mon Mar 12 13:51:02 2012 +1000 Change lastDeviceIdleTime to be per-device X.Org Bug 56649 Signed-off-by: Peter Hutterer Tested-by: Giacomo Perale Reviewed-by: Keith Packard --- Xext/saver.c | 2 ++ dix/window.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Xext/saver.c b/Xext/saver.c index ac4a633e7..f73e2a21f 100644 --- a/Xext/saver.c +++ b/Xext/saver.c @@ -393,6 +393,8 @@ ScreenSaverFreeSuspend(pointer value, XID id) UpdateCurrentTimeIf(); nt_list_for_each_entry(dev, inputInfo.devices, next) lastDeviceEventTime[dev->id] = currentTime; + lastDeviceEventTime[XIAllDevices] = currentTime; + lastDeviceEventTime[XIAllMasterDevices] = currentTime; SetScreenSaverTimer(); } } diff --git a/dix/window.c b/dix/window.c index e70531af6..99b3e0a13 100644 --- a/dix/window.c +++ b/dix/window.c @@ -3095,6 +3095,8 @@ dixSaveScreens(ClientPtr client, int on, int mode) UpdateCurrentTimeIf(); nt_list_for_each_entry(dev, inputInfo.devices, next) lastDeviceEventTime[dev->id] = currentTime; + lastDeviceEventTime[XIAllDevices] = currentTime; + lastDeviceEventTime[XIAllMasterDevices] = currentTime; } SetScreenSaverTimer(); } -- cgit v1.2.3 From 2c4388a00ec308bc2d48ba751ff510cd5c1b2384 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 26 Jun 2012 10:30:35 +1000 Subject: xkb: fill in keycode and event type for slow keys enablement eventType is set for the type that triggered a XkbControlsNotify event. Technically, SlowKeys is triggered by a timer which doesn't have a matching core event type. So we used to use 0 here. Practically, the timer is triggered by a key press + hold and cancelled when the key is released before the timeout expires. So we might as well set KeyPress (keycode) in the ControlsNotify to give clients a chance to differ between timer-triggered SlowKeys and client-triggered ones. This is a chance in behaviour, though I suspect with little impact. Signed-off-by: Peter Hutterer Acked-by: Daniel Stone --- include/xkbsrv.h | 1 + xkb/xkbAccessX.c | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/xkbsrv.h b/include/xkbsrv.h index 2b926a980..45e2e8c47 100644 --- a/include/xkbsrv.h +++ b/include/xkbsrv.h @@ -171,6 +171,7 @@ typedef struct _XkbSrvInfo { KeyCode mouseKey; KeyCode inactiveKey; KeyCode slowKey; + KeyCode slowKeyEnableKey; KeyCode repeatKey; CARD8 krgTimerActive; CARD8 beepType; diff --git a/xkb/xkbAccessX.c b/xkb/xkbAccessX.c index c1af32eb9..21df85d94 100644 --- a/xkb/xkbAccessX.c +++ b/xkb/xkbAccessX.c @@ -291,8 +291,8 @@ AccessXKRGExpire(OsTimerPtr timer, CARD32 now, pointer arg) return 4000; } xkbi->krgTimerActive = _OFF_TIMER; - cn.keycode = 0; - cn.eventType = 0; + cn.keycode = xkbi->slowKeyEnableKey; + cn.eventType = KeyPress; cn.requestMajor = 0; cn.requestMinor = 0; if (xkbi->desc->ctrls->enabled_ctrls & XkbSlowKeysMask) { @@ -304,6 +304,7 @@ AccessXKRGExpire(OsTimerPtr timer, CARD32 now, pointer arg) LogMessage(X_INFO, "XKB SlowKeys are now enabled. Hold shift to disable.\n"); } + xkbi->slowKeyEnableKey = 0; return 0; } @@ -462,6 +463,7 @@ AccessXFilterPressEvent(DeviceEvent *event, DeviceIntPtr keybd) if (ctrls->enabled_ctrls & XkbAccessXKeysMask) { /* check for magic sequences */ if ((sym[0] == XK_Shift_R) || (sym[0] == XK_Shift_L)) { + xkbi->slowKeyEnableKey = key; if (XkbAX_NeedFeedback(ctrls, XkbAX_SlowWarnFBMask)) { xkbi->krgTimerActive = _KRG_WARN_TIMER; xkbi->krgTimer = TimerSet(xkbi->krgTimer, 0, 4000, -- cgit v1.2.3 From 59d70b30e93f8be93db9e873423353f7e4419811 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 23 Nov 2012 10:05:02 +1000 Subject: dix: use pixman for fp1616 conversions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Peter Hutterer Reviewed-by: Søren Sandmann > --- dix/inpututils.c | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/dix/inpututils.c b/dix/inpututils.c index f01e9a7cd..eb2222a07 100644 --- a/dix/inpututils.c +++ b/dix/inpututils.c @@ -910,11 +910,7 @@ input_option_set_value(InputOption *opt, const char *value) double fp1616_to_double(FP1616 in) { - double ret; - - ret = (double) (in >> 16); - ret += (double) (in & 0xffff) * (1.0 / (1UL << 16)); /* Optimized: ldexp((double)(in & 0xffff), -16); */ - return ret; + return pixman_fixed_to_double(in); } double @@ -930,20 +926,7 @@ fp3232_to_double(FP3232 in) FP1616 double_to_fp1616(double in) { - FP1616 ret; - int32_t integral; - double tmp; - uint32_t frac_d; - - tmp = floor(in); - integral = (int32_t) tmp; - - tmp = (in - integral) * (1UL << 16); /* Optimized: ldexp(in - integral, 16) */ - frac_d = (uint16_t) tmp; - - ret = integral << 16; - ret |= frac_d & 0xffff; - return ret; + return pixman_double_to_fixed(in); } FP3232 -- cgit v1.2.3 From 6e18599d691036eca6ff082c17727d9ffb926984 Mon Sep 17 00:00:00 2001 From: Sybren van Elderen Date: Tue, 27 Nov 2012 19:27:10 +0100 Subject: hw/dmx: add update_desktop_dimensions() call The Xdmx server did not update the desktop dimensions when computing screen origins. Signed-off-by: Sybren van Elderen Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer --- hw/dmx/dmxcursor.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/dmx/dmxcursor.c b/hw/dmx/dmxcursor.c index 1a77c7d78..35aca81b4 100644 --- a/hw/dmx/dmxcursor.c +++ b/hw/dmx/dmxcursor.c @@ -346,6 +346,8 @@ dmxComputeScreenOrigins(void) screenInfo.screens[i]->y -= minY; } } + + update_desktop_dimensions(); } /** Recompute origin information in the #dmxScreens list. This is -- cgit v1.2.3