ports/121580: xmodmap does not work in startup file
Tsurutani Naoki
turutani at scphys.kyoto-u.ac.jp
Mon Mar 10 22:20:01 UTC 2008
>Number: 121580
>Category: ports
>Synopsis: xmodmap does not work in startup file
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Mon Mar 10 22:20:00 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator: Tsurutani Naoki
>Release: FreeBSD 6.3-PRERELEASE i386
>Organization:
>Environment:
System: FreeBSD polymer3.scphys.kyoto-u.ac.jp 6.3-PRERELEASE FreeBSD 6.3-PRERELEASE #11: Wed Jan 16 16:30:07 JST 2008 turutani at polymer3.scphys.kyoto-u.ac.jp:/usr/local/work/usr/obj/usr/src/sys/POLYMER i386
>Description:
xmodmap does not work in .xinitrc.
Once X server started, xmodmap works fine if xmodmap has not been done
in .xinitrc etc.
>How-To-Repeat:
always start X server with "startx".
this does not happen using xdm.
>Fix:
add the following patch to ports/x11-servers/xorg-server/files/.
this fix is already incorporated into xorg-server source tree.
--- Xi/exevents.c.orig 2007-08-24 04:04:52.000000000 +0900
+++ Xi/exevents.c 2008-03-10 10:32:31.000000000 +0900
@@ -73,6 +73,10 @@
#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 @@
}
void
-SendDeviceMappingNotify(CARD8 request,
+SendDeviceMappingNotify(ClientPtr client, CARD8 request,
KeyCode firstKeyCode, CARD8 count, DeviceIntPtr dev)
{
xEvent event;
@@ -957,6 +961,11 @@
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 @@
keysyms.map = map;
if (!SetKeySymsMap(&k->curKeySyms, &keysyms))
return BadAlloc;
- SendDeviceMappingNotify(MappingKeyboard, firstKeyCode, keyCodes, dev);
+ SendDeviceMappingNotify(client, MappingKeyboard, firstKeyCode, keyCodes, dev);
return client->noClientException;
}
--- Xi/setbmap.c.orig 2007-08-24 04:04:52.000000000 +0900
+++ Xi/setbmap.c 2008-03-10 10:33:08.000000000 +0900
@@ -134,7 +134,7 @@
}
if (ret != MappingBusy)
- SendDeviceMappingNotify(MappingPointer, 0, 0, dev);
+ SendDeviceMappingNotify(client, MappingPointer, 0, 0, dev);
return Success;
}
--- Xi/setmmap.c.orig 2007-08-24 04:04:52.000000000 +0900
+++ Xi/setmmap.c 2008-03-10 10:33:38.000000000 +0900
@@ -122,7 +122,7 @@
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 {
--- dix/devices.c.orig 2008-03-10 10:25:54.000000000 +0900
+++ dix/devices.c 2008-03-10 10:37:36.000000000 +0900
@@ -1369,6 +1369,7 @@
ProcSetModifierMapping(ClientPtr client)
{
xSetModifierMappingReply rep;
+ DeviceIntPtr dev;
REQUEST(xSetModifierMappingReq);
REQUEST_AT_LEAST_SIZE(xSetModifierMappingReq);
@@ -1386,6 +1387,9 @@
/* FIXME: Send mapping notifies for all the extended devices as well. */
SendMappingNotify(MappingModifier, 0, 0, client);
+ for (dev = inputInfo.devices; dev; dev = dev->next)
+ if (dev->key && dev->coreEvents)
+ SendDeviceMappingNotify(client, MappingModifier, 0, 0, dev);
WriteReplyToClient(client, sizeof(xSetModifierMappingReply), &rep);
return client->noClientException;
}
@@ -1458,6 +1462,12 @@
/* FIXME: Send mapping notifies for all the extended devices as well. */
SendMappingNotify(MappingKeyboard, stuff->firstKeyCode, stuff->keyCodes,
client);
+ for (pDev = inputInfo.devices; pDev; pDev = pDev->next)
+ if (pDev->key && pDev->coreEvents)
+ SendDeviceMappingNotify(client, MappingKeyboard,
+ stuff->firstKeyCode, stuff->keyCodes,
+ pDev);
+
return client->noClientException;
}
--- include/exevents.h.orig 2007-08-24 04:04:54.000000000 +0900
+++ include/exevents.h 2008-03-10 10:38:19.000000000 +0900
@@ -129,6 +129,7 @@
KeyClassPtr * /* k */);
extern void SendDeviceMappingNotify(
+ ClientPtr /* client, */,
CARD8 /* request, */,
KeyCode /* firstKeyCode */,
CARD8 /* count */,
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list