I noticed that xdm wasn't respecting ~/.Xmodmap and I went hunting around and made this patch to /etc/X11/xdm/Xsession which seems to fix the problem. I based it on the logic in /etc/X11/xinit/xinitrc. Now ~/.Xmodmap is loaded by xdm. I didn't have any problems with ~/.Xresources not loading, which I find confusing. Perhaps that is being loaded from somewhere else? # diff -u /etc/X11/xdm/Xsession~ /etc/X11/xdm/Xsession --- /etc/X11/xdm/Xsession~ 2006-03-05 09:57:14.000000000 +1100 +++ /etc/X11/xdm/Xsession 2006-04-01 09:43:26.000000000 +1000 @@ -30,6 +30,24 @@ sysresources=$xinitdir/.Xresources sysmodmap=$xinitdir/.Xmodmap +# merge in defaults and keymaps + +if [ -f $sysresources ]; then + xrdb -merge $sysresources +fi + +if [ -f $sysmodmap ]; then + xmodmap $sysmodmap +fi + +if [ -f $userresources ]; then + xrdb -merge $userresources +fi + +if [ -f $usermodmap ]; then + xmodmap $usermodmap +fi + # First run the system default. Because KDE uses this # to switch sessions, we MUST first check the system # default, and then ~/.xsession. If the user Do not @@ -39,25 +57,6 @@ exec "`/etc/X11/chooser.sh`" # If not defined, try the user's ~/.xsession elif [ -s "$startup" ]; then - - # merge in defaults and keymaps - - if [ -f $sysresources ]; then - xrdb -merge $sysresources - fi - - if [ -f $sysmodmap ]; then - xmodmap $sysmodmap - fi - - if [ -f $userresources ]; then - xrdb -merge $userresources - fi - - if [ -f $usermodmap ]; then - xmodmap $usermodmap - fi - if [ -x "$startup" ]; then exec "$startup" else ----------------- # emerge info x11-base/xorg-x11 Portage 2.0.54 (default-linux/x86/2005.1, gcc-3.3.6, glibc-2.3.5-r2, 2.6.12-gentoo-r6 i686) ================================================================= System uname: 2.6.12-gentoo-r6 i686 AMD Athlon(tm) XP 2500+ Gentoo Base System version 1.6.14 dev-lang/python: 2.3.5, 2.4.2 sys-apps/sandbox: 1.2.12 sys-devel/autoconf: 2.13, 2.59-r7 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1 sys-devel/binutils: 2.16.1 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-O2 -pipe -march=athlon-xp" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O2 -pipe -march=athlon-xp" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig distlocks sandbox sfperms strict" GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" SYNC="rsync://mirror.isp.net.au/gentoo-portage" USE="x86 3dnow 3dnowext X alsa apm audiofile avi bash-completion berkdb bitmap-fonts bzip2 cdr crypt cups curl dri dvd eds emboss encode exif expat fam foomaticdb fortran gd gdbm gif glut gmp gpm gstreamer gtk gtk2 idn imagemagick imlib ipv6 jpeg lcms libg++ libwww mad mikmod mmx mng motif mp3 mpeg ncurses nls ogg oggvorbis openal opengl oss pam pcre pdflib perl png postgres python qt quicktime readline ruby samba sdl spell ssl tcpd tiff truetype truetype-fonts type1-fonts udev vorbis win32codecs xml2 xmms xv xvid zlib userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY
*** Bug 48263 has been marked as a duplicate of this bug. ***
I still have this problem with current package versions. Whenever I log into KDE I have to execute "xmodmap /etc/X11/Xmodmap" to get mouse and keyboard working properly.
Another Source. http://www.ugcs.caltech.edu/~q/code/xdm_bio-1.0.5.patch
Created attachment 104763 [details, diff] Make KDE heed the xmodmap configuration I hunted around some more to fix this problem and found the instruction at "http://gentoo-wiki.com/HOWTO_Advanced_Mouse#KDM_and_KDE" saying: Another way is to add the following lines to ${kdedir}/share/config/kdm/Xsession to fix the .Xmodmap issue for all users: File: ${kdedir}/share/config/kdm/Xsession exec /usr/bin/xmodmap -e "pointer = default" if [ -f "$HOME/.Xmodmap" ] then exec /usr/bin/xmodmap "$HOME/.Xmodmap" & fi Note: Touching files in ${kdedir} may mean merging configuration files on a point release, or copying these changes to new files on a major release. I followed the instruction and it put an end to my pain of having to execute "xmodmap /etc/X11/Xmodmap" after each login (when noticing that the scrollwheel does not work again). I thought it would be best for me and other users to also put an end to the pain of redoing this change after every emerge of a kdm version. Therefore I try to make that configuration persistent by adding it in the source. The patch could be applied during the emerge.
xdm is old and we have very little incentive to fix it. I'd rather avoid breaking it since the whole X startup scripts are very fragile. If you want your own .Xmodmap to be picked up, better have your own .xsession or .xinitrc, depending on which ever works. Thanks