summaryrefslogtreecommitdiff
path: root/Xi
diff options
context:
space:
mode:
authorPeter Hutterer <peter@cs.unisa.edu.au>2008-03-04 18:11:10 +1030
committerPeter Hutterer <peter@cs.unisa.edu.au>2008-03-04 18:11:10 +1030
commit4f2cd0ed96d3b10c78774c721c2ffbfb0556dddd (patch)
tree9f477ddd4af2162152057bded1426102b475e67c /Xi
parent23ae68a4c74a2ec90b4130c37b0d0aec3f4082ce (diff)
parent453661a9e193a511cf5e54e6d330454163817316 (diff)
Merge branch 'master' into mpx
This merge reverts Magnus' device coorindate scaling changes. MPX core event generation is very different, so we can't scale in GetPointerEvents. Conflicts: Xi/opendev.c dix/devices.c dix/dixfonts.c dix/getevents.c dix/resource.c dix/window.c hw/xfree86/common/xf86Xinput.c mi/mipointer.c xkb/ddxBeep.c xkb/ddxCtrls.c xkb/ddxKeyClick.c xkb/ddxList.c xkb/ddxLoad.c xkb/xkb.c xkb/xkbAccessX.c xkb/xkbEvents.c xkb/xkbInit.c xkb/xkbPrKeyEv.c xkb/xkbUtils.c
Diffstat (limited to 'Xi')
-rw-r--r--Xi/chgdctl.c37
-rw-r--r--Xi/chgfctl.c2
-rw-r--r--Xi/chgkmap.c2
-rw-r--r--Xi/closedev.c2
-rw-r--r--Xi/opendev.c3
-rw-r--r--Xi/setbmap.c2
-rw-r--r--Xi/setmmap.c2
7 files changed, 43 insertions, 7 deletions
diff --git a/Xi/chgdctl.c b/Xi/chgdctl.c
index 937bb38e4..26b79f6dc 100644
--- a/Xi/chgdctl.c
+++ b/Xi/chgdctl.c
@@ -77,11 +77,46 @@ int
SProcXChangeDeviceControl(ClientPtr client)
{
char n;
+ xDeviceCtl *ctl;
+ xDeviceAbsCalibCtl *calib;
+ xDeviceAbsAreaCtl *area;
REQUEST(xChangeDeviceControlReq);
swaps(&stuff->length, n);
REQUEST_AT_LEAST_SIZE(xChangeDeviceControlReq);
swaps(&stuff->control, n);
+ ctl = (xDeviceCtl*)&stuff[1];
+ swaps(&ctl->control, n);
+ swaps(&ctl->length, n);
+ switch(stuff->control) {
+ case DEVICE_ABS_CALIB:
+ calib = (xDeviceAbsCalibCtl*)ctl;
+ swaps(&calib->length, n);
+ swapl(&calib->min_x, n);
+ swapl(&calib->max_x, n);
+ swapl(&calib->min_y, n);
+ swapl(&calib->max_y, n);
+ swapl(&calib->flip_x, n);
+ swapl(&calib->flip_y, n);
+ swapl(&calib->rotation, n);
+ swapl(&calib->button_threshold, n);
+ break;
+ case DEVICE_ABS_AREA:
+ area = (xDeviceAbsAreaCtl*)ctl;
+ swapl(&area->offset_x, n);
+ swapl(&area->offset_y, n);
+ swapl(&area->width, n);
+ swapl(&area->height, n);
+ swapl(&area->screen, n);
+ swapl(&area->following, n);
+ break;
+ case DEVICE_CORE:
+ case DEVICE_ENABLE:
+ case DEVICE_RESOLUTION:
+ /* hmm. beer. *drool* */
+ break;
+
+ }
return (ProcXChangeDeviceControl(client));
}
@@ -111,7 +146,7 @@ ProcXChangeDeviceControl(ClientPtr client)
REQUEST_AT_LEAST_SIZE(xChangeDeviceControlReq);
len = stuff->length - (sizeof(xChangeDeviceControlReq) >> 2);
- ret = dixLookupDevice(&dev, stuff->deviceid, client, DixSetAttrAccess);
+ ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
if (ret != Success)
goto out;
diff --git a/Xi/chgfctl.c b/Xi/chgfctl.c
index 696b74a16..3155e87c2 100644
--- a/Xi/chgfctl.c
+++ b/Xi/chgfctl.c
@@ -444,7 +444,7 @@ ProcXChangeFeedbackControl(ClientPtr client)
REQUEST_AT_LEAST_SIZE(xChangeFeedbackControlReq);
len = stuff->length - (sizeof(xChangeFeedbackControlReq) >> 2);
- rc = dixLookupDevice(&dev, stuff->deviceid, client, DixSetAttrAccess);
+ rc = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
if (rc != Success)
return rc;
diff --git a/Xi/chgkmap.c b/Xi/chgkmap.c
index df334c11c..3f51648e1 100644
--- a/Xi/chgkmap.c
+++ b/Xi/chgkmap.c
@@ -106,7 +106,7 @@ ProcXChangeDeviceKeyMapping(ClientPtr client)
count = stuff->keyCodes * stuff->keySymsPerKeyCode;
REQUEST_FIXED_SIZE(xChangeDeviceKeyMappingReq, count * sizeof(CARD32));
- ret = dixLookupDevice(&dev, stuff->deviceid, client, DixSetAttrAccess);
+ ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
if (ret != Success)
return ret;
len = stuff->length - (sizeof(xChangeDeviceKeyMappingReq) >> 2);
diff --git a/Xi/closedev.c b/Xi/closedev.c
index 4c593ec2f..2be908c4a 100644
--- a/Xi/closedev.c
+++ b/Xi/closedev.c
@@ -146,7 +146,7 @@ ProcXCloseDevice(ClientPtr client)
REQUEST(xCloseDeviceReq);
REQUEST_SIZE_MATCH(xCloseDeviceReq);
- rc = dixLookupDevice(&d, stuff->deviceid, client, DixGetAttrAccess);
+ rc = dixLookupDevice(&d, stuff->deviceid, client, DixUseAccess);
if (rc != Success)
return rc;
diff --git a/Xi/opendev.c b/Xi/opendev.c
index f4c0066ec..f14f848bf 100644
--- a/Xi/opendev.c
+++ b/Xi/opendev.c
@@ -102,7 +102,8 @@ ProcXOpenDevice(ClientPtr client)
REQUEST(xOpenDeviceReq);
REQUEST_SIZE_MATCH(xOpenDeviceReq);
- status = dixLookupDevice(&dev, stuff->deviceid, client, DixReadAccess);
+ status = dixLookupDevice(&dev, stuff->deviceid, client, DixUseAccess);
+
if (status == BadDevice) { /* not open */
for (dev = inputInfo.off_devices; dev; dev = dev->next)
if (dev->id == stuff->deviceid)
diff --git a/Xi/setbmap.c b/Xi/setbmap.c
index 3035c649e..f05225531 100644
--- a/Xi/setbmap.c
+++ b/Xi/setbmap.c
@@ -109,7 +109,7 @@ ProcXSetDeviceButtonMapping(ClientPtr client)
rep.sequenceNumber = client->sequence;
rep.status = MappingSuccess;
- ret = dixLookupDevice(&dev, stuff->deviceid, client, DixSetAttrAccess);
+ ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
if (ret != Success)
return ret;
diff --git a/Xi/setmmap.c b/Xi/setmmap.c
index be3d3cb6c..34efde595 100644
--- a/Xi/setmmap.c
+++ b/Xi/setmmap.c
@@ -98,7 +98,7 @@ ProcXSetDeviceModifierMapping(ClientPtr client)
REQUEST(xSetDeviceModifierMappingReq);
REQUEST_AT_LEAST_SIZE(xSetDeviceModifierMappingReq);
- ret = dixLookupDevice(&dev, stuff->deviceid, client, DixSetAttrAccess);
+ ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
if (ret != Success)
return ret;