diff options
Diffstat (limited to 'xorg-server/Xi/exevents.c')
-rw-r--r-- | xorg-server/Xi/exevents.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/xorg-server/Xi/exevents.c b/xorg-server/Xi/exevents.c index 74a78ecf2..053c76f22 100644 --- a/xorg-server/Xi/exevents.c +++ b/xorg-server/Xi/exevents.c @@ -651,7 +651,7 @@ DeepCopyDeviceClasses(DeviceIntPtr from, DeviceIntPtr to, DeviceChangedEvent *dc * Send an XI2 DeviceChangedEvent to all interested clients. */ void -XISendDeviceChangedEvent(DeviceIntPtr device, DeviceIntPtr master, DeviceChangedEvent *dce) +XISendDeviceChangedEvent(DeviceIntPtr device, DeviceChangedEvent *dce) { xXIDeviceChangedEvent *dcce; int rc; @@ -665,7 +665,7 @@ XISendDeviceChangedEvent(DeviceIntPtr device, DeviceIntPtr master, DeviceChanged /* we don't actually swap if there's a NullClient, swapping is done * later when event is delivered. */ - SendEventToAllWindows(master, XI_DeviceChangedMask, (xEvent*)dcce, 1); + SendEventToAllWindows(device, XI_DeviceChangedMask, (xEvent*)dcce, 1); free(dcce); } @@ -699,7 +699,8 @@ ChangeMasterDeviceClasses(DeviceIntPtr device, DeviceChangedEvent *dce) /* FIXME: the classes may have changed since we generated the event. */ DeepCopyDeviceClasses(slave, device, dce); - XISendDeviceChangedEvent(slave, device, dce); + dce->deviceid = device->id; + XISendDeviceChangedEvent(device, dce); } /** @@ -1102,6 +1103,8 @@ SetScrollValuator(DeviceIntPtr dev, int axnum, enum ScrollType type, double incr { AxisInfoPtr ax; int *current_ax; + InternalEvent dce; + DeviceIntPtr master; if (!dev || !dev->valuator || axnum >= dev->valuator->numAxes) return FALSE; @@ -1138,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); + 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); return TRUE; } |