[PATCH 14/20] dix: fix a master device access in change_modmap.

Peter Hutterer peter.hutterer at who-t.net
Thu Feb 17 19:52:21 PST 2011


We need to check if our master keyboard is the given device since we may be
a pointer with keys and thus need to change the modmap too.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 dix/inpututils.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dix/inpututils.c b/dix/inpututils.c
index 8b7b035..abeabf2 100644
--- a/dix/inpututils.c
+++ b/dix/inpututils.c
@@ -268,12 +268,12 @@ change_modmap(ClientPtr client, DeviceIntPtr dev, KeyCode *modkeymap,
     /* Change any attached masters/slaves. */
     if (IsMaster(dev)) {
         for (tmp = inputInfo.devices; tmp; tmp = tmp->next) {
-            if (!IsMaster(tmp) && tmp->u.master == dev)
+            if (!IsMaster(tmp) && GetMaster(tmp, MASTER_KEYBOARD) == dev)
                 if (check_modmap_change_slave(client, dev, tmp, modmap))
                     do_modmap_change(client, tmp, modmap);
         }
     }
-    else if (!IsFloating(dev) && dev->u.master->u.lastSlave == dev) {
+    else if (!IsFloating(dev) && GetMaster(dev, MASTER_KEYBOARD)->u.lastSlave == dev) {
         /* If this fails, expect the results to be weird. */
         if (check_modmap_change(client, dev->u.master, modmap))
             do_modmap_change(client, dev->u.master, modmap);
-- 
1.7.4



More information about the xorg-devel mailing list