diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2011-10-19 13:17:51 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-10-25 14:06:41 +1000 |
commit | 4bb5d8fae4f9a70f12591315f0b267a2ea826a0c (patch) | |
tree | 1c5f617456f081f7e68d67e6c957367d34872c67 | |
parent | 1f4af6c12fb5d4c19f4eac3df768517c9132cc88 (diff) |
Xi: send DeviceChangedEvents when the scroll valuators change value
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
-rw-r--r-- | Xi/exevents.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c index 7afb69e24..053c76f22 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -1103,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; @@ -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); + 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; } |