Update the MD's position when a touch event is received

Signed-off-by: Thomas Jaeger <ThJaeger@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
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 <ThJaeger@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>

[Added call to processInputProc instead of direct call to DeliverTouchEvents]

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
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 <ThJaeger@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Simplify GetTouchEvents

With only one callee left, we are free to assume that
!(flags & TOUCH_CLIENT_ID)

Signed-off-by: Thomas Jaeger <ThJaeger@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
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 <ynovikov@chromium.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
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 <jstpierre@mecheye.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
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 <peter.hutterer@who-t.net>
Date:   Mon Mar 12 13:51:02 2012 +1000

    Change lastDeviceIdleTime to be per-device

X.Org Bug 56649 <http://bugs.freedesktop.org/show_bug.cgi?id=56649>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Giacomo Perale <ghepeu@virgilio.it>
Reviewed-by: Keith Packard <keithp@keithp.com>
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 <peter.hutterer@who-t.net>
Acked-by: Daniel Stone <daniel@fooishbar.org>
dix: use pixman for fp1616 conversions

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Søren Sandmann <ssp@redhat.com>>
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 <sowmestno@msn.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Merge branch 'high-resolution-touch-devices' into for-keith
randr: call RRProviderInit in the proper place.

No idea where this got lost across development cycles, but its
definitely missing.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=57448

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Merge remote-tracking branch 'whot/for-keith'
xkb: always post XTest button up when the physical button released (#28808)

Regression introduced by commit 2decff6393a44b56d80d53570718f95354fde454
  xkb: ProcesssPointerEvent must work on the VCP if it gets the VCP

XTest buttons must be released when a physical button is released. This was
fixed in 14327858391ebe929b806efb53ad79e789361883, but
2decff6393a44b56d80d53570718f95354fde454 changed a condition that this code
didn't get triggered anymore.

"dev" for pointer events is now always the VCP which doesn't have a xkbi
struct. So move this condition out and always trigger the XTest released for
button events.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Frank Roscher <Frank-Roscher@gmx.net>
xkb: only post a XTest release if the XTest device has the button down

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Fix formatting of address operators

The formatter confused address operators preceded by casts with
bitwise-and expressions, placing spaces on either side of both.
That syntax isn't used by ordinary address operators, however,
so fix them for consistency.

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
include: fix comment

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
xfixes: Fix minor number in QueryVersion

Due to a typo the major version number was passed as minor version to
version_compare().

Regression-from: ffd4874798ba54f86acac75779a15b4babeaa5f3

Signed-off-by: Daniel Martin <consume.noise@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
dri1: fix dri1 startup since 459c6da0f907ba33d733c7e62a116184ba2f14e5

This commit regresses dri1 since it moves the drmSetServerInfo from being
called at module load time to extension init time. However DRIScreenInit
relies on this being called before it gets control.

This patches moves the call into DRIScreenInit and seems to work here.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Revert "xf86: Fix non-PCI configuration-less setups"

This reverts commit 76d9c62eb2be2010a19bf36285012d086cdd180b.

This breaks multi-GPU setups here, so lets drop it for now.

Signed-off-by: Dave Airlie <airlied@redhat.com>