summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamir Benmendil <me@rmz.io>2018-03-03 01:41:12 +0000
committerAdam Jackson <ajax@redhat.com>2018-03-05 13:41:29 -0500
commit5d3fd3856b718cfbc87d17f1de698ced94923c78 (patch)
tree402870cdd23e63f00111628435111eec386a1ae7
parentce8da936464cc78ec31de6e970e1353ffecf2547 (diff)
xkb: XkbSetMap on the lastSlave needs to change the master
The layout needs to be set on the master too if the layout is changed on the device that was last used by the master. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=85256 Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=91571 Signed-off-by: Samir Benmendil <me@rmz.io> Acked-by: Daniel Stone <daniels@collabora.com>
-rw-r--r--xkb/xkb.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/xkb/xkb.c b/xkb/xkb.c
index 392023f4c..0fe6ebf4a 100644
--- a/xkb/xkb.c
+++ b/xkb/xkb.c
@@ -2627,6 +2627,8 @@ ProcXkbSetMap(ClientPtr client)
if (rc != Success)
return rc;
+ DeviceIntPtr master = GetMaster(dev, MASTER_KEYBOARD);
+
if (stuff->deviceSpec == XkbUseCoreKbd) {
DeviceIntPtr other;
@@ -2642,9 +2644,21 @@ ProcXkbSetMap(ClientPtr client)
}
}
}
+ } else {
+ DeviceIntPtr other;
+
+ for (other = inputInfo.devices; other; other = other->next) {
+ if (other != dev && GetMaster(other, MASTER_KEYBOARD) != dev &&
+ (other != master || dev != master->lastSlave))
+ continue;
+
+ rc = _XkbSetMapChecks(client, other, stuff, tmp);
+ if (rc != Success)
+ return rc;
+ }
}
- /* We know now that we will succed with the SetMap. In theory anyway. */
+ /* We know now that we will succeed with the SetMap. In theory anyway. */
rc = _XkbSetMap(client, dev, stuff, tmp);
if (rc != Success)
return rc;
@@ -2665,6 +2679,16 @@ ProcXkbSetMap(ClientPtr client)
sync. */
}
}
+ } else {
+ DeviceIntPtr other;
+
+ for (other = inputInfo.devices; other; other = other->next) {
+ if (other != dev && GetMaster(other, MASTER_KEYBOARD) != dev &&
+ (other != master || dev != master->lastSlave))
+ continue;
+
+ _XkbSetMap(client, other, stuff, tmp); //ignore rc
+ }
}
return Success;