diff options
author | marha <marha@users.sourceforge.net> | 2013-02-11 08:02:10 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2013-02-11 08:02:10 +0100 |
commit | 8753441b3ba4316448e1ae5f408e6a84b0116a3c (patch) | |
tree | 8defe6bffed265e0846489015877f2384f022e67 /xorg-server/dix/devices.c | |
parent | 212958ab41363d50d87470f6fb47bbcdc7a74c74 (diff) | |
download | vcxsrv-8753441b3ba4316448e1ae5f408e6a84b0116a3c.tar.gz vcxsrv-8753441b3ba4316448e1ae5f408e6a84b0116a3c.tar.bz2 vcxsrv-8753441b3ba4316448e1ae5f408e6a84b0116a3c.zip |
xserver mesa git update 11 Feb 2013
xserver commit c1602d1c17967bdd4db9db19b3a9c0dfca6a58aa
mesa commit 990bd49fba7d539e950bdda6eb9819a9abf14850
Diffstat (limited to 'xorg-server/dix/devices.c')
-rw-r--r-- | xorg-server/dix/devices.c | 46 |
1 files changed, 39 insertions, 7 deletions
diff --git a/xorg-server/dix/devices.c b/xorg-server/dix/devices.c index 3c7d480c6..be236dd70 100644 --- a/xorg-server/dix/devices.c +++ b/xorg-server/dix/devices.c @@ -93,9 +93,10 @@ SOFTWARE. static void RecalculateMasterButtons(DeviceIntPtr slave); static void -DeviceSetTransform(DeviceIntPtr dev, float *transform) +DeviceSetTransform(DeviceIntPtr dev, float *transform_data) { struct pixman_f_transform scale; + struct pixman_f_transform transform; double sx, sy; int x, y; @@ -122,16 +123,21 @@ DeviceSetTransform(DeviceIntPtr dev, float *transform) /* transform */ for (y = 0; y < 3; y++) for (x = 0; x < 3; x++) - dev->transform.m[y][x] = *transform++; + transform.m[y][x] = *transform_data++; - pixman_f_transform_multiply(&dev->transform, &scale, &dev->transform); + pixman_f_transform_multiply(&dev->scale_and_transform, &scale, &transform); /* scale */ pixman_f_transform_init_scale(&scale, 1.0 / sx, 1.0 / sy); scale.m[0][2] = -dev->valuator->axes[0].min_value / sx; scale.m[1][2] = -dev->valuator->axes[1].min_value / sy; - pixman_f_transform_multiply(&dev->transform, &dev->transform, &scale); + pixman_f_transform_multiply(&dev->scale_and_transform, &dev->scale_and_transform, &scale); + + /* remove translation component for relative movements */ + dev->relative_transform = transform; + dev->relative_transform.m[0][2] = 0; + dev->relative_transform.m[1][2] = 0; } /** @@ -308,9 +314,10 @@ AddInputDevice(ClientPtr client, DeviceProc deviceProc, Bool autoStart) /* unity matrix */ memset(transform, 0, sizeof(transform)); transform[0] = transform[4] = transform[8] = 1.0f; - dev->transform.m[0][0] = 1.0; - dev->transform.m[1][1] = 1.0; - dev->transform.m[2][2] = 1.0; + dev->relative_transform.m[0][0] = 1.0; + dev->relative_transform.m[1][1] = 1.0; + dev->relative_transform.m[2][2] = 1.0; + dev->scale_and_transform = dev->relative_transform; XIChangeDeviceProperty(dev, XIGetKnownProperty(XI_PROP_TRANSFORM), XIGetKnownProperty(XATOM_FLOAT), 32, @@ -516,6 +523,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); @@ -1043,6 +1056,25 @@ CloseDownDevices(void) } /** + * Signal all devices that we're in the process of aborting. + * This function is called from a signal handler. + */ +void +AbortDevices(void) +{ + DeviceIntPtr dev; + nt_list_for_each_entry(dev, inputInfo.devices, next) { + if (!IsMaster(dev)) + (*dev->deviceProc) (dev, DEVICE_ABORT); + } + + nt_list_for_each_entry(dev, inputInfo.off_devices, next) { + if (!IsMaster(dev)) + (*dev->deviceProc) (dev, DEVICE_ABORT); + } +} + +/** * Remove the cursor sprite for all devices. This needs to be done before any * resources are freed or any device is deleted. */ |