[PATCH 6/6] Xi: send DeviceChangedEvents when the scroll valuators change value

Daniel Stone daniel at fooishbar.org
Thu Oct 20 06:11:26 PDT 2011


Hi,

On Thu, Oct 20, 2011 at 04:25:46PM +1000, Peter Hutterer wrote:
> @@ -1139,7 +1141,16 @@ SetScrollValuator(DeviceIntPtr dev, int axnum, enum ScrollType type, double incr
>      ax->scroll.type = type;
>      ax->scroll.increment = increment;
>      ax->scroll.flags = flags;
> -    /* FIXME: generate DeviceChanged Events */
> +
> +    master = GetMaster(dev, MASTER_ATTACHED);
> +    CreateClassesChangedEvent(&dce, master, dev, DEVCHANGE_POINTER_EVENT | DEVCHANGE_DEVICE_CHANGE);

Long line here.

> +    XISendDeviceChangedEvent(dev, &dce.changed_event);
> +
> +    /* if the current slave is us, update the master. If not, we'll update
> +     * whenever the next slave switch happens anyway. CMDC sends the event
> +     * for us */
> +    if (master && master->lastSlave == dev)
> +        ChangeMasterDeviceClasses(master, &dce.changed_event);

And the whole logic -- create slave event, optionally create master
event if the device was the last slave -- is probably something we can
centralise for great justice.

Still:
Reviewed-by: Daniel Stone <daniel at fooishbar.org>

Cheers,
Daniel


More information about the xorg-devel mailing list