[arch-commits] CVS update of extra/x11/xorg-server (10 files)

Alexander Baldeck alexander at archlinux.org
Sun Dec 23 16:09:10 EST 2007


    Date: Sunday, December 23, 2007 @ 16:09:10
  Author: alexander
    Path: /home/cvs-extra/extra/x11/xorg-server

   Added: 100_avoid_acpi_insanity.diff (1.1)
          101_fedora-apm-typedefs.patch (1.1)
          102_ubuntu_sharevts_load_cpu.patch (1.1)
          104_fedora_init_origins_fix.patch (1.1)
          120_fedora_xserver-xaa-evict-pixmaps.patch (1.1)
          142_fedora_xserver-1.3.0-no-pseudocolor-composite.patch (1.1)
          144_fedora_xserver-1.3.0-xnest-exposures.patch (1.1)
Modified: PKGBUILD (1.43 -> 1.44)
          xorg-redhat-die-ugly-pattern-die-die-die.patch (1.2 -> 1.3)
 Removed: xorg-server-1.4-mapping-changes-for-all.diff (1.1)

* readded ugly-pattern patch by public request
* more fixes importet from Ubuntu


---------------------------------------------------------+
 100_avoid_acpi_insanity.diff                            |   12 +
 101_fedora-apm-typedefs.patch                           |   40 +++
 102_ubuntu_sharevts_load_cpu.patch                      |   28 ++
 104_fedora_init_origins_fix.patch                       |   27 ++
 120_fedora_xserver-xaa-evict-pixmaps.patch              |   79 +++++++
 142_fedora_xserver-1.3.0-no-pseudocolor-composite.patch |   30 ++
 144_fedora_xserver-1.3.0-xnest-exposures.patch          |   20 +
 PKGBUILD                                                |   43 +++
 xorg-redhat-die-ugly-pattern-die-die-die.patch          |   16 +
 xorg-server-1.4-mapping-changes-for-all.diff            |  155 --------------
 10 files changed, 287 insertions(+), 163 deletions(-)


Index: extra/x11/xorg-server/100_avoid_acpi_insanity.diff
diff -u /dev/null extra/x11/xorg-server/100_avoid_acpi_insanity.diff:1.1
--- /dev/null	Sun Dec 23 16:09:11 2007
+++ extra/x11/xorg-server/100_avoid_acpi_insanity.diff	Sun Dec 23 16:09:10 2007
@@ -0,0 +1,12 @@
+diff -ur xorg-server-1.3.0.0.dfsg/hw/xfree86/os-support/linux/lnx_acpi.c xorg-server-1.3.0.0.dfsg.new/hw/xfree86/os-support/linux/lnx_acpi.c
+--- xorg-server-1.3.0.0.dfsg/hw/xfree86/os-support/linux/lnx_acpi.c	2006-11-16 18:01:25.000000000 +0000
++++ xorg-server-1.3.0.0.dfsg.new/hw/xfree86/os-support/linux/lnx_acpi.c	2007-08-26 16:14:34.000000000 +0100
+@@ -110,6 +110,8 @@
+ 		case ACPI_VIDEO_NOTIFY_PREV_OUTPUT:
+ 			break;
+ 		default:
++			/* If it's not a switch notification, send nothing */
++			return 0;
+ 			break;
+ 	}
+ 
Index: extra/x11/xorg-server/101_fedora-apm-typedefs.patch
diff -u /dev/null extra/x11/xorg-server/101_fedora-apm-typedefs.patch:1.1
--- /dev/null	Sun Dec 23 16:09:11 2007
+++ extra/x11/xorg-server/101_fedora-apm-typedefs.patch	Sun Dec 23 16:09:10 2007
@@ -0,0 +1,40 @@
+From 3fd969f08e4f550ac28fee3bbdbe55e9db872091 Mon Sep 17 00:00:00 2001
+From: Adam Jackson <ajax at redhat.com>
+Date: Mon, 3 Dec 2007 14:00:25 -0500
+Subject: [PATCH] apm_event_t workaround
+
+---
+ hw/kdrive/linux/linux.c               |    2 ++
+ hw/xfree86/os-support/linux/lnx_apm.c |    3 +++
+ 2 files changed, 5 insertions(+), 0 deletions(-)
+
+diff --git a/hw/kdrive/linux/linux.c b/hw/kdrive/linux/linux.c
+index 23cd8f5..2f9cb62 100644
+--- a/hw/kdrive/linux/linux.c
++++ b/hw/kdrive/linux/linux.c
+@@ -275,6 +275,8 @@ LinuxApmBlock (pointer blockData, OSTimePtr pTimeout, pointer pReadmask)
+ 
+ static Bool LinuxApmRunning;
+ 
++#define apm_event_t unsigned short
++
+ static void
+ LinuxApmWakeup (pointer blockData, int result, pointer pReadmask)
+ {
+diff --git a/hw/xfree86/os-support/linux/lnx_apm.c b/hw/xfree86/os-support/linux/lnx_apm.c
+index 16ac80d..6bcae47 100644
+--- a/hw/xfree86/os-support/linux/lnx_apm.c
++++ b/hw/xfree86/os-support/linux/lnx_apm.c
+@@ -39,6 +39,9 @@ static PMClose lnxAPMOpen(void);
+ static void lnxCloseAPM(void);
+ static pointer APMihPtr = NULL;
+ 
++/* XXX this is wrong, do not ever commit me upstream */
++#define apm_event_t unsigned short
++
+ static struct {
+     apm_event_t apmLinux;
+     pmEvent xf86;
+-- 
+1.5.2.4
+
Index: extra/x11/xorg-server/102_ubuntu_sharevts_load_cpu.patch
diff -u /dev/null extra/x11/xorg-server/102_ubuntu_sharevts_load_cpu.patch:1.1
--- /dev/null	Sun Dec 23 16:09:11 2007
+++ extra/x11/xorg-server/102_ubuntu_sharevts_load_cpu.patch	Sun Dec 23 16:09:10 2007
@@ -0,0 +1,28 @@
+Index: a/hw/xfree86/os-support/linux/lnx_init.c
+===================================================================
+--- a/hw/xfree86/os-support/linux/lnx_init.c	2007-01-23 07:39:16.000000000 +0200
++++ b/xfree86/os-support/linux/lnx_init.c	2007-02-08 15:44:03.000000000 +0200
+@@ -284,9 +284,7 @@
+ 	        FatalError("Unable to set screen info\n");
+ 	    close(fbfd);
+ #endif
+-        } else { /* ShareVTs */
+-            close(xf86Info.consoleFd);
+-        }
++	}
+ 	signal(SIGUSR2, xf86ReloadInputDevs);
+     } else { 	/* serverGeneration != 1 */
+         if (!ShareVTs && VTSwitch)
+@@ -315,7 +313,11 @@
+     int vtno = -1;
+ #endif
+ 
+-    if (ShareVTs) return;
++    if (ShareVTs)
++    {
++	    close(xf86Info.consoleFd);
++	    return;
++    }
+ 
+ #if defined(DO_OS_FONTRESTORE)
+     if (ioctl(xf86Info.consoleFd, VT_GETSTATE, &vts) < 0)
Index: extra/x11/xorg-server/104_fedora_init_origins_fix.patch
diff -u /dev/null extra/x11/xorg-server/104_fedora_init_origins_fix.patch:1.1
--- /dev/null	Sun Dec 23 16:09:11 2007
+++ extra/x11/xorg-server/104_fedora_init_origins_fix.patch	Sun Dec 23 16:09:10 2007
@@ -0,0 +1,27 @@
+Patch by krh at redhat.com:
+
+      In a multihead setup, if only the first screen can be
+      initialized, but the second screen is mentioned first in the
+      ServerLayout section, the xf86InitOrigins() function will crash
+      because the screen referred to in the e.g. "RightOf" part is
+      non-existent.
+
+Index: a/hw/xfree86/common/xf86Cursor.c
+===================================================================
+--- a/hw/xfree86/common/xf86Cursor.c.orig	2007-01-23 07:39:15.000000000 +0200
++++ a/hw/xfree86/common/xf86Cursor.c	2007-02-08 15:45:02.000000000 +0200
+@@ -569,6 +569,14 @@
+ 
+ 	    screen = &xf86ConfigLayout.screens[i];
+ 
++	    if (screen->refscreen != NULL &&
++		screen->refscreen->screennum >= xf86NumScreens) {
++		screensLeft &= ~(1 << i);
++	        xf86Msg(X_WARNING, "Not including screen \"%s\" in origins calculation.\n",
++			screen->screen->id);
++	        continue;
++	    }	      
++
+ 	    switch(screen->where) {
+ 	    case PosObsolete:
+ 		OldStyleConfig = TRUE;
Index: extra/x11/xorg-server/120_fedora_xserver-xaa-evict-pixmaps.patch
diff -u /dev/null extra/x11/xorg-server/120_fedora_xserver-xaa-evict-pixmaps.patch:1.1
--- /dev/null	Sun Dec 23 16:09:11 2007
+++ extra/x11/xorg-server/120_fedora_xserver-xaa-evict-pixmaps.patch	Sun Dec 23 16:09:10 2007
@@ -0,0 +1,79 @@
+From fb3008787193b79909fe922577794f7d4a656922 Mon Sep 17 00:00:00 2001
+From: Adam Jackson <ajax at redhat.com>
+Date: Thu, 1 Nov 2007 15:18:31 -0400
+Subject: [PATCH] Add pixmap eviction call for XAA.
+
+DRI drivers without zero-copy EXT_texture_from_pixmap need to copy the
+texture image out of video memory to bind it.  Ick.  Add a hack to
+evict XAA pixmaps and disable the pixmap cache when the first texture
+is bound.
+---
+ GL/glx/glxdri.c          |   16 ++++++++++++++++
+ hw/xfree86/xaa/xaaInit.c |   24 ++++++++++++++++++++++++
+ 2 files changed, 40 insertions(+), 0 deletions(-)
+
+diff --git a/GL/glx/glxdri.c b/GL/glx/glxdri.c
+index c0da07b..6c4faed 100644
+--- a/GL/glx/glxdri.c
++++ b/GL/glx/glxdri.c
+@@ -360,6 +360,22 @@ __glXDRIbindTexImage(__GLXcontext *baseContext,
+ 
+     pixmap = (PixmapPtr) glxPixmap->pDraw;
+ 
++    if (!screen->texOffsetStart) {
++         /* When the GLX_EXT_texture_from_pixmap is used, as it's
++          * implemented here, we want to pull pixmap out of video memory
++          * and into host memory. */
++         extern void XAAEvictPixmaps(void);
++         static int evictedPixmaps = 0;
++
++         if (!evictedPixmaps) {
++             __glXDRIenterServer(GL_FALSE);
++                 if (dlsym(RTLD_DEFAULT, "XAAEvictPixmaps"))
++                      XAAEvictPixmaps();
++             __glXDRIleaveServer(GL_FALSE);
++         evictedPixmaps = TRUE;
++         }
++    }
++
+     if (screen->texOffsetStart && screen->driScreen.setTexOffset) {
+         __GLXpixmap **texOffsetOverride = screen->texOffsetOverride;
+         int i, firstEmpty = 16, texname;
+diff --git a/hw/xfree86/xaa/xaaInit.c b/hw/xfree86/xaa/xaaInit.c
+index 4222425..602b525 100644
+--- a/hw/xfree86/xaa/xaaInit.c
++++ b/hw/xfree86/xaa/xaaInit.c
+@@ -88,6 +88,30 @@ XAADestroyInfoRec(XAAInfoRecPtr infoRec)
+     xfree(infoRec);
+ }
+ 
++void
++XAAEvictPixmaps(void)
++{
++    XAAScreenPtr pScreenPriv;
++    XAAInfoRecPtr infoRec;
++    ScreenPtr pScreen;
++    int i;
++
++    xf86MsgVerb(X_INFO, 3, "XAA: Evicting pixmaps\n");
++
++    for (i = 0; i < screenInfo.numScreens; i++) {
++	pScreen = screenInfo.screens[i];
++	infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
++
++	pScreenPriv = pScreen->devPrivates[XAAScreenIndex].ptr;
++	infoRec = pScreenPriv->AccelInfoRec;
++
++	infoRec->offscreenDepths = 0;
++	infoRec->Flags &= ~OFFSCREEN_PIXMAPS;
++
++	XAAMoveOutOffscreenPixmaps(pScreen);
++	XAAInvalidatePixmapCache(pScreen);
++    }
++}
+ 
+ Bool 
+ XAAInit(ScreenPtr pScreen, XAAInfoRecPtr infoRec)
+-- 
+1.5.3.4
+
Index: extra/x11/xorg-server/142_fedora_xserver-1.3.0-no-pseudocolor-composite.patch
diff -u /dev/null extra/x11/xorg-server/142_fedora_xserver-1.3.0-no-pseudocolor-composite.patch:1.1
--- /dev/null	Sun Dec 23 16:09:11 2007
+++ extra/x11/xorg-server/142_fedora_xserver-1.3.0-no-pseudocolor-composite.patch	Sun Dec 23 16:09:10 2007
@@ -0,0 +1,30 @@
+diff --git a/composite/compext.c b/composite/compext.c
+index 4c25cc7..af05b4a 100644
+--- a/composite/compext.c
++++ b/composite/compext.c
+@@ -678,6 +678,25 @@ CompositeExtensionInit (void)
+     ExtensionEntry  *extEntry;
+     int		    s;
+ 
++    for (s = 0; s < screenInfo.numScreens; s++) {
++	ScreenPtr pScreen = screenInfo.screens[s];
++	VisualPtr vis;
++
++	/* Composite on 8bpp pseudocolor root windows appears to fail, so
++	 * just disable it on anything pseudocolor for safety.
++	 */
++	for (vis = pScreen->visuals; vis->vid != pScreen->rootVisual; vis++)
++	    ;
++	if ((vis->class | DynamicClass) == PseudoColor)
++	    return;
++
++	/* Ensure that Render is initialized, which is required for automatic
++	 * compositing.
++	 */
++	if (GetPictureScreenIfSet(pScreen) == NULL)
++	    return;
++    }
++
+     CompositeClientWindowType = CreateNewResourceType (FreeCompositeClientWindow);
+     if (!CompositeClientWindowType)
+ 	return;
Index: extra/x11/xorg-server/144_fedora_xserver-1.3.0-xnest-exposures.patch
diff -u /dev/null extra/x11/xorg-server/144_fedora_xserver-1.3.0-xnest-exposures.patch:1.1
--- /dev/null	Sun Dec 23 16:09:11 2007
+++ extra/x11/xorg-server/144_fedora_xserver-1.3.0-xnest-exposures.patch	Sun Dec 23 16:09:10 2007
@@ -0,0 +1,20 @@
+--- xorg-server-1.2.99.905/hw/xnest/Events.c.jx	2007-01-31 19:55:51.000000000 -0500
++++ xorg-server-1.2.99.905/hw/xnest/Events.c	2007-04-09 18:42:51.000000000 -0400
+@@ -85,7 +85,7 @@
+   while (XCheckIfEvent(xnestDisplay, &X, xnestExposurePredicate, NULL)) {
+     pWin = xnestWindowPtr(X.xexpose.window);
+     
+-    if (pWin) {
++    if (pWin && X.xexpose.width && X.xexpose.height) {
+       Box.x1 = pWin->drawable.x + wBorderWidth(pWin) + X.xexpose.x;
+       Box.y1 = pWin->drawable.y + wBorderWidth(pWin) + X.xexpose.y;
+       Box.x2 = Box.x1 + X.xexpose.width;
+@@ -93,7 +93,7 @@
+       
+       REGION_INIT(pWin->drawable.pScreen, &Rgn, &Box, 1);
+       
+-      miWindowExposures(pWin, &Rgn, NullRegion); 
++      miSendExposures(pWin, &Rgn, Box.x2, Box.y2);
+     }
+   }
+ }
Index: extra/x11/xorg-server/PKGBUILD
diff -u extra/x11/xorg-server/PKGBUILD:1.43 extra/x11/xorg-server/PKGBUILD:1.44
--- extra/x11/xorg-server/PKGBUILD:1.43	Sat Dec 22 12:51:31 2007
+++ extra/x11/xorg-server/PKGBUILD	Sun Dec 23 16:09:10 2007
@@ -1,22 +1,22 @@
-# $Id: PKGBUILD,v 1.43 2007/12/22 17:51:31 alexander Exp $
+# $Id: PKGBUILD,v 1.44 2007/12/23 21:09:10 alexander Exp $
 # Maintainer: Alexander Baldeck <kth5 at archlinux.org>
 # Contributor: Jan de Groot <jgc at archlinux.org>
 pkgname=xorg-server
 pkgver=1.4.0.90
-pkgrel=2
+pkgrel=3
 _mesaver=7.0.1
 pkgdesc="X.Org X servers"
 arch=('i686' 'x86_64')
 url="http://xorg.freedesktop.org"
-depends=('gcc' 'libxkbui' 'ncurses' 'libxi' 'libxxf86misc' 'libxfont'
+depends=('gcc-libs' 'libxkbui' 'ncurses' 'libxi' 'libxxf86misc' 'libxfont'
          'libxrender' 'libdmx' 'libxaw' 'libxxf86vm' 'xcursor-themes'
 	 'xkeyboard-config' 'xorg-server-utils' 'xorg-utils' 'libdrm>=2.3.0'
-	 'libxfixes' 'xorg-fonts-misc' 'pixman>=0.9.6' 'xbitmaps')
+	 'libxfixes' 'xorg-fonts-misc' 'pixman>=0.9.6' 'xbitmaps' 'libgl')
 makedepends=('pkgconfig' 'xf86driproto' 'xcmiscproto' 'xtrans' 'bigreqsproto'
              'xf86bigfontproto' 'resourceproto' 'evieext' 'damageproto>=1.1.0'
 	     'compositeproto>=0.4' 'scrnsaverproto' 'libxres' 'xorg-util-macros'
 	     'randrproto' 'glproto>=1.4.9' 'renderproto>=0.9.3' 'autoconf' 'automake'
-	     'libtool' 'bison' 'flex')
+	     'libtool' 'bison' 'flex' 'gcc')
 options=('!libtool')
 provides=('x-server')
 groups=('xorg')
@@ -24,6 +24,7 @@
 source=(${url}/releases/individual/xserver/${pkgname}-${pkgver}.tar.bz2
 	http://downloads.sourceforge.net/mesa3d/MesaLib-${_mesaver}.tar.bz2
 	xorg-server-1.2.0-defaultdpi.patch
+	xorg-redhat-die-ugly-pattern-die-die-die.patch
 	001_ubuntu_add_extra_modelines_from_xorg.patch
 	01-kernel-headers-fix.patch
 	02_libvgahw_gcc4_volatile_fix.diff
@@ -44,7 +45,15 @@
 	91_ttf2pt1_updates
 	92_xprint-security-holes-fix.patch
 	93_spooltodir_check_file_exists
-	93_xprint_fonts_fix)
+	93_xprint_fonts_fix
+	144_fedora_xserver-1.3.0-xnest-exposures.patch
+	101_fedora-apm-typedefs.patch
+	142_fedora_xserver-1.3.0-no-pseudocolor-composite.patch
+	100_avoid_acpi_insanity.diff
+	120_fedora_xserver-xaa-evict-pixmaps.patch
+	121_only_switch_vt_when_active.diff
+	102_ubuntu_sharevts_load_cpu.patch
+	104_fedora_init_origins_fix.patch)
 
 build() {
   cd ${startdir}/src/${pkgname}-${pkgver}
@@ -71,9 +80,18 @@
   patch -Np1 -i ${startdir}/src/92_xprint-security-holes-fix.patch || return 1
   patch -Np1 -i ${startdir}/src/93_spooltodir_check_file_exists || return 1
   patch -Np1 -i ${startdir}/src/93_xprint_fonts_fix || return 1
+  patch -Np1 -i ${startdir}/src/144_fedora_xserver-1.3.0-xnest-exposures.patch || return 1
+  patch -Np1 -i ${startdir}/src/101_fedora-apm-typedefs.patch || return 1
+  patch -Np1 -i ${startdir}/src/142_fedora_xserver-1.3.0-no-pseudocolor-composite.patch || return 1
+  patch -Np1 -i ${startdir}/src/100_avoid_acpi_insanity.diff || return 1
+  patch -Np1 -i ${startdir}/src/120_fedora_xserver-xaa-evict-pixmaps.patch || return 1
+  patch -Np1 -i ${startdir}/src/121_only_switch_vt_when_active.diff || return 1
+  patch -Np1 -i ${startdir}/src/102_ubuntu_sharevts_load_cpu.patch || return 1
+  patch -Np1 -i ${startdir}/src/104_fedora_init_origins_fix.patch || return 1
 
   # Own patches
   patch -Np1 -i ${startdir}/src/xorg-server-1.2.0-defaultdpi.patch || return 1
+  patch -Np3 -i ${startdir}/src/xorg-redhat-die-ugly-pattern-die-die-die.patch || return 1
 
   #cd GL/
   #./symlink-mesa.sh ${startdir}/src/Mesa-${_mesaver}/ . || return 1
@@ -128,6 +146,7 @@
 md5sums=('bb16e969850dbb5d3805cb88d35656d0'
          'c056abd763e899114bf745c9eedbf9ad'
          'e162134c68230f7b168430fe73b4881a'
+         '1a336eb22e27cbf443ec5a2ecddfa93c'
          '117ca8113ad0977a8f769734e8599a10'
          '7bedf609cd7717f58f991b6a9380b2a5'
          '12a725071633d8140c22237efd954787'
@@ -144,8 +163,16 @@
          '74e675c11d94d0bddcec7c74c220bf71'
          '13a69065ee4b99e6ba9eb9b4fd121a1f'
          '63a819f88186cead0cff54296c0d4050'
-         'c281e6d4454d22ee22381a9404f9f580'
+         'fb913bdce59b8361fad2aae505e1516d'
          '2110d7a26a7674ebcffbf7d6887a0167'
          '697454ba6f2c5f77a100693b72440079'
          'acbca762bbb532f2577bd57b29660e11'
-         '430f5fae7a12e5052a5b03990c2b1fb7')
+         '430f5fae7a12e5052a5b03990c2b1fb7'
+         '37755b716f0be03e4a243d907899b746'
+         '793548b46eaa5fca3acd810c9d58167d'
+         '586cf862905a9b571a5c6fae9b538650'
+         'aa089de9ab6cb2bd54ea102f3934ccc6'
+         '151d3233c367b80253c0bbf1fe8d41c6'
+         'd7a5dd4cadf1ed70adc7e12fdf3133d2'
+         '128f9245b2787479fcbf082f9e148aa8'
+         '1dc001817b7a3951a63876415ad1eb91')
Index: extra/x11/xorg-server/xorg-redhat-die-ugly-pattern-die-die-die.patch
diff -u /dev/null extra/x11/xorg-server/xorg-redhat-die-ugly-pattern-die-die-die.patch:1.3
--- /dev/null	Sun Dec 23 16:09:11 2007
+++ extra/x11/xorg-server/xorg-redhat-die-ugly-pattern-die-die-die.patch	Sun Dec 23 16:09:10 2007
@@ -0,0 +1,16 @@
+Remove the default root window grey stipple pattern, replacing it with
+blackness.
+
+--- xc/programs/Xserver/dix/window.c.die-ugly-pattern-die-die-die	Tue Feb 12 16:33:04 2002
++++ xc/programs/Xserver/dix/window.c	Tue Feb 12 16:45:32 2002
+@@ -119,8 +119,8 @@
+  *
+  ******/
+ 
+-static unsigned char _back_lsb[4] = {0x88, 0x22, 0x44, 0x11};
+-static unsigned char _back_msb[4] = {0x11, 0x44, 0x22, 0x88};
++static unsigned char _back_lsb[4] = {0x00, 0x00, 0x00, 0x00};
++static unsigned char _back_msb[4] = {0x00, 0x00, 0x00, 0x00};
+ 
+ int screenIsSaved = SCREEN_SAVER_OFF;
+ 
Index: extra/x11/xorg-server/xorg-server-1.4-mapping-changes-for-all.diff
diff -u extra/x11/xorg-server/xorg-server-1.4-mapping-changes-for-all.diff:1.1 extra/x11/xorg-server/xorg-server-1.4-mapping-changes-for-all.diff:removed
--- extra/x11/xorg-server/xorg-server-1.4-mapping-changes-for-all.diff:1.1	Fri Nov 16 08:12:10 2007
+++ extra/x11/xorg-server/xorg-server-1.4-mapping-changes-for-all.diff	Sun Dec 23 16:09:11 2007
@@ -1,155 +0,0 @@
-commit 27ad5d74c20f01516a1bff73be283f8982fcf0fe
-Author: Daniel Stone <daniel at fooishbar.org>
-Date:   Sun Sep 23 17:17:03 2007 +0300
-
-    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.
-
-diff --git a/Xi/exevents.c b/Xi/exevents.c
-index fe297ab..377311e 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 bdfa513..1f5970d 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 0078499..e30213e 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 {
-diff --git a/dix/devices.c b/dix/devices.c
-index 9f3c576..e05444e 100644
---- a/dix/devices.c
-+++ b/dix/devices.c
-@@ -1208,10 +1208,9 @@ SendMappingNotify(unsigned request, unsigned firstKeyCode, unsigned count,
-     }
- #ifdef XKB
-     if (!noXkbExtension &&
--	((request == MappingKeyboard) || (request == MappingModifier))) {
--	XkbApplyMappingChange(inputInfo.keyboard,request,firstKeyCode,count,
--									client);
--    }
-+	((request == MappingKeyboard) || (request == MappingModifier)))
-+        XkbApplyMappingChange(inputInfo.keyboard, request, firstKeyCode, count,
-+                              client);
- #endif
- 
-    /* 0 is the server client */
-@@ -1359,6 +1358,7 @@ int
- ProcSetModifierMapping(ClientPtr client)
- {
-     xSetModifierMappingReply rep;
-+    DeviceIntPtr dev;
-     REQUEST(xSetModifierMappingReq);
-     
-     REQUEST_AT_LEAST_SIZE(xSetModifierMappingReq);
-@@ -1374,8 +1374,10 @@ ProcSetModifierMapping(ClientPtr client)
-     rep.success = DoSetModifierMapping(client, (KeyCode *)&stuff[1],
-                                        stuff->numKeyPerModifier);
- 
--    /* 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;
- }
-@@ -1438,16 +1440,19 @@ ProcChangeKeyboardMapping(ClientPtr client)
-     keysyms.maxKeyCode = stuff->firstKeyCode + stuff->keyCodes - 1;
-     keysyms.mapWidth = stuff->keySymsPerKeyCode;
-     keysyms.map = (KeySym *)&stuff[1];
--    for (pDev = inputInfo.devices; pDev; pDev = pDev->next) {
--        if ((pDev->coreEvents || pDev == inputInfo.keyboard) && pDev->key) {
-+    for (pDev = inputInfo.devices; pDev; pDev = pDev->next)
-+        if ((pDev->coreEvents || pDev == inputInfo.keyboard) && pDev->key)
-             if (!SetKeySymsMap(&pDev->key->curKeySyms, &keysyms))
-                 return BadAlloc;
--        }
--    }
- 
--    /* 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;
- }
- 
-diff --git a/include/exevents.h b/include/exevents.h
-index 69d4abc..cf7d71a 100644
---- a/include/exevents.h
-+++ b/include/exevents.h
-@@ -129,6 +129,7 @@ extern int SetModifierMapping(
- 	KeyClassPtr *          /* k */);
- 
- extern void SendDeviceMappingNotify(
-+        ClientPtr              /* client, */,
- 	CARD8                  /* request, */,
- 	KeyCode                /* firstKeyCode */,
- 	CARD8                  /* count */,




More information about the arch-commits mailing list