Skip to content

Commit

Permalink
Merge remote branch 'whot/for-keith'
Browse files Browse the repository at this point in the history
  • Loading branch information
keith-packard committed Mar 9, 2011
2 parents a19771e + 7355555 commit c3c0e2f
Show file tree
Hide file tree
Showing 13 changed files with 164 additions and 157 deletions.
4 changes: 2 additions & 2 deletions Xi/xipassivegrab.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,15 +191,15 @@ ProcXIPassiveGrabDevice(ClientPtr client)
info->status = status;
info->modifiers = *modifiers;
rep.num_modifiers++;
rep.length++;
rep.length += bytes_to_int32(sizeof(xXIGrabModifierInfo));
}
}

WriteReplyToClient(client, sizeof(rep), &rep);
if (rep.num_modifiers)
{
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
WriteSwappedDataToClient(client, rep.num_modifiers * 4, (char*)modifiers_failed);
WriteSwappedDataToClient(client, rep.length * 4, (char*)modifiers_failed);
}
free(modifiers_failed);
return ret;
Expand Down
4 changes: 2 additions & 2 deletions Xi/xiproperty.c
Original file line number Diff line number Diff line change
Expand Up @@ -1051,11 +1051,11 @@ SProcXChangeDeviceProperty (ClientPtr client)
char n;
REQUEST(xChangeDevicePropertyReq);

REQUEST_AT_LEAST_SIZE(xChangeDevicePropertyReq);
swaps(&stuff->length, n);
swapl(&stuff->property, n);
swapl(&stuff->type, n);
swapl(&stuff->nUnits, n);
REQUEST_SIZE_MATCH(xChangeDevicePropertyReq);
return (ProcXChangeDeviceProperty(client));
}

Expand Down Expand Up @@ -1295,12 +1295,12 @@ SProcXIChangeProperty(ClientPtr client)
char n;
REQUEST(xXIChangePropertyReq);

REQUEST_AT_LEAST_SIZE(xXIChangePropertyReq);
swaps(&stuff->length, n);
swaps(&stuff->deviceid, n);
swapl(&stuff->property, n);
swapl(&stuff->type, n);
swapl(&stuff->num_items, n);
REQUEST_SIZE_MATCH(xXIChangePropertyReq);
return (ProcXIChangeProperty(client));
}

Expand Down
6 changes: 3 additions & 3 deletions config/hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,10 +392,10 @@ device_added(LibHalContext *hal_ctx, const char *udi)
free(driver);
free(name);
free(config_info);
while (!dev && (tmpo = options)) {
while ((tmpo = options)) {
options = tmpo->next;
free(tmpo->key);
free(tmpo->value);
free(tmpo->key); /* NULL if dev != NULL */
free(tmpo->value); /* NULL if dev != NULL */
free(tmpo);
}

Expand Down
6 changes: 3 additions & 3 deletions config/udev.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,10 @@ device_added(struct udev_device *udev_device)

unwind:
free(config_info);
while (!dev && (tmpo = options)) {
while ((tmpo = options)) {
options = tmpo->next;
free(tmpo->key);
free(tmpo->value);
free(tmpo->key); /* NULL if dev != NULL */
free(tmpo->value); /* NULL if dev != NULL */
free(tmpo);
}

Expand Down
2 changes: 2 additions & 0 deletions dix/devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -938,6 +938,8 @@ CloseDevice(DeviceIntPtr dev)
}

free(dev->deviceGrab.sync.event);
free(dev->config_info); /* Allocated in xf86ActivateDevice. */
dev->config_info = NULL;
dixFreeObjectWithPrivates(dev, PRIVATE_DEVICE);
}

Expand Down
3 changes: 3 additions & 0 deletions dix/eventconvert.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,9 @@ eventToKeyButtonPointer(DeviceEvent *ev, xEvent **xi, int *count)
case ET_ProximityOut:
*count = 0;
return BadMatch;
default:
*count = 0;
return BadImplementation;
}
}

Expand Down
26 changes: 5 additions & 21 deletions dix/getevents.c
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ moveRelative(DeviceIntPtr dev, int *x, int *y, ValuatorMask *mask)
/* if attached, clip both x and y to the defined limits (usually
* co-ord space limit). If it is attached, we need x/y to go over the
* limits to be able to change screens. */
if(dev->valuator && IsMaster(dev) || !IsFloating(dev)) {
if (dev->valuator && (IsMaster(dev) || !IsFloating(dev))) {
if (valuator_get_mode(dev, 0) == Absolute)
clipAxis(dev, 0, x);
if (valuator_get_mode(dev, 1) == Absolute)
Expand All @@ -791,17 +791,14 @@ moveRelative(DeviceIntPtr dev, int *x, int *y, ValuatorMask *mask)
* Accelerate the data in valuators based on the device's acceleration scheme.
*
* @param dev The device which's pointer is to be moved.
* @param first The first valuator in @valuators
* @param num Total number of valuators in @valuators.
* @param valuators Valuator data for each axis between @first and
* @first+@num.
* @param valuators Valuator mask
* @param ms Current time.
*/
static void
accelPointer(DeviceIntPtr dev, int first, int num, int *valuators, CARD32 ms)
accelPointer(DeviceIntPtr dev, ValuatorMask* valuators, CARD32 ms)
{
if (dev->valuator->accelScheme.AccelSchemeProc)
dev->valuator->accelScheme.AccelSchemeProc(dev, first, num, valuators, ms);
dev->valuator->accelScheme.AccelSchemeProc(dev, valuators, ms);
}

/**
Expand Down Expand Up @@ -1170,20 +1167,7 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons,
moveAbsolute(pDev, &x, &y, &mask);
} else {
if (flags & POINTER_ACCELERATE) {
/* FIXME: Pointer acceleration only requires X and Y values. This
* should be converted to masked valuators. */
int vals[2];
vals[0] = valuator_mask_isset(&mask, 0) ?
valuator_mask_get(&mask, 0) : 0;
vals[1] = valuator_mask_isset(&mask, 1) ?
valuator_mask_get(&mask, 1) : 0;
accelPointer(pDev, 0, 2, vals, ms);

if (valuator_mask_isset(&mask, 0))
valuator_mask_set(&mask, 0, vals[0]);
if (valuator_mask_isset(&mask, 1))
valuator_mask_set(&mask, 1, vals[1]);

accelPointer(pDev, &mask, ms);
/* The pointer acceleration code modifies the fractional part
* in-place, so we need to extract this information first */
x_frac = pDev->last.remainder[0];
Expand Down
Loading

0 comments on commit c3c0e2f

Please sign in to comment.