summaryrefslogtreecommitdiff
path: root/Xi
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2007-09-23 17:17:03 +0300
committerDaniel Stone <daniel@fooishbar.org>2007-09-23 17:17:20 +0300
commit27ad5d74c20f01516a1bff73be283f8982fcf0fe (patch)
treee8e39584834479a62205f5c5585ed2372d597762 /Xi
parent0e800ca4651a947ccef239e6fe7bf64aab92257c (diff)
Input: Generate XKB mapping changes for all core-sending devices (bug #12523)
When we change the mapping on a core device, make sure we propagate this through to XKB for all extended devices as well.
Diffstat (limited to 'Xi')
-rw-r--r--Xi/exevents.c13
-rw-r--r--Xi/setbmap.c2
-rw-r--r--Xi/setmmap.c2
3 files changed, 13 insertions, 4 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c
index fe297ab6a..377311ec9 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -73,6 +73,10 @@ SOFTWARE.
#include "dixgrabs.h" /* CreateGrab() */
#include "scrnintstr.h"
+#ifdef XKB
+#include "xkbsrv.h"
+#endif
+
#define WID(w) ((w) ? ((w)->drawable.id) : 0)
#define AllModifiersMask ( \
ShiftMask | LockMask | ControlMask | Mod1Mask | Mod2Mask | \
@@ -942,7 +946,7 @@ SetModifierMapping(ClientPtr client, DeviceIntPtr dev, int len, int rlen,
}
void
-SendDeviceMappingNotify(CARD8 request,
+SendDeviceMappingNotify(ClientPtr client, CARD8 request,
KeyCode firstKeyCode, CARD8 count, DeviceIntPtr dev)
{
xEvent event;
@@ -957,6 +961,11 @@ SendDeviceMappingNotify(CARD8 request,
ev->count = count;
}
+#ifdef XKB
+ if (request == MappingKeyboard || request == MappingModifier)
+ XkbApplyMappingChange(dev, request, firstKeyCode, count, client);
+#endif
+
SendEventToAllWindows(dev, DeviceMappingNotifyMask, (xEvent *) ev, 1);
}
@@ -992,7 +1001,7 @@ ChangeKeyMapping(ClientPtr client,
keysyms.map = map;
if (!SetKeySymsMap(&k->curKeySyms, &keysyms))
return BadAlloc;
- SendDeviceMappingNotify(MappingKeyboard, firstKeyCode, keyCodes, dev);
+ SendDeviceMappingNotify(client, MappingKeyboard, firstKeyCode, keyCodes, dev);
return client->noClientException;
}
diff --git a/Xi/setbmap.c b/Xi/setbmap.c
index bdfa513dd..1f5970dee 100644
--- a/Xi/setbmap.c
+++ b/Xi/setbmap.c
@@ -134,7 +134,7 @@ ProcXSetDeviceButtonMapping(ClientPtr client)
}
if (ret != MappingBusy)
- SendDeviceMappingNotify(MappingPointer, 0, 0, dev);
+ SendDeviceMappingNotify(client, MappingPointer, 0, 0, dev);
return Success;
}
diff --git a/Xi/setmmap.c b/Xi/setmmap.c
index 00784995a..e30213e8a 100644
--- a/Xi/setmmap.c
+++ b/Xi/setmmap.c
@@ -122,7 +122,7 @@ ProcXSetDeviceModifierMapping(ClientPtr client)
if (ret == MappingSuccess || ret == MappingBusy || ret == MappingFailed) {
rep.success = ret;
if (ret == MappingSuccess)
- SendDeviceMappingNotify(MappingModifier, 0, 0, dev);
+ SendDeviceMappingNotify(client, MappingModifier, 0, 0, dev);
WriteReplyToClient(client, sizeof(xSetDeviceModifierMappingReply),
&rep);
} else {