[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

xorg-server: Changes to 'ubuntu'



 Xext/xtest.c                        |    2 
 Xi/exevents.c                       |   20 
 Xi/queryst.c                        |    3 
 configure.ac                        |    5 
 debian/changelog                    |    6 
 dix/devices.c                       |   32 -
 dix/events.c                        |   29 
 dix/getevents.c                     |   14 
 dix/main.c                          |   14 
 exa/exa_glyphs.c                    |    9 
 hw/xfree86/modes/xf86Rotate.c       |    8 
 hw/xquartz/GL/indirect.c            | 1122 +++++++++---------------------------
 hw/xquartz/X11Application.m         |   12 
 hw/xquartz/X11Controller.m          |   17 
 hw/xquartz/bundle/Makefile.am       |    5 
 hw/xquartz/bundle/mk_bundke.sh      |   16 
 hw/xquartz/darwinEvents.c           |    4 
 hw/xquartz/darwinEvents.h           |    3 
 hw/xquartz/mach-startup/Makefile.am |    4 
 hw/xquartz/xpr/dri.c                |  207 ++++--
 include/Makefile.am                 |    2 
 include/dix-config-apple-verbatim.h |    8 
 include/dix-config.h.in             |    6 
 include/input.h                     |    1 
 include/inputstr.h                  |    9 
 mi/mi.h                             |    4 
 mi/mieq.c                           |   51 +
 mi/mipointer.c                      |    2 
 randr/randr.c                       |    2 
 randr/randrstr.h                    |    2 
 randr/rrcrtc.c                      |   23 
 randr/rrinfo.c                      |   10 
 randr/rroutput.c                    |    5 
 randr/rrscreen.c                    |   21 
 randr/rrxinerama.c                  |   50 +
 xkb/ddxDevBtn.c                     |    2 
 xkb/xkbActions.c                    |    4 
 37 files changed, 675 insertions(+), 1059 deletions(-)

New commits:
commit 3d7b356c1b6290212274289d0cf92c418a8aa58f
Author: Timo Aaltonen <tjaalton@cc.hut.fi>
Date:   Sat Jan 31 11:04:58 2009 +0200

    Release 2:1.5.99.902-0ubuntu1

diff --git a/debian/changelog b/debian/changelog
index e695671..c426fb0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+xorg-server (2:1.5.99.902-0ubuntu1) jaunty; urgency=low
+
+  * New upstream release candidate.
+
+ -- Timo Aaltonen <tjaalton@ubuntu.com>  Sat, 31 Jan 2009 11:03:52 +0200
+
 xorg-server (2:1.5.99.901-1ubuntu1) jaunty; urgency=low
 
   * Merge with Debian experimental.

commit 1f729b42d567ae9533ac0e467afc9fbc83390776
Author: Keith Packard <keithp@keithp.com>
Date:   Fri Jan 30 21:12:17 2009 -0800

    Version to 1.5.99.902

diff --git a/configure.ac b/configure.ac
index da5f488..61b8b12 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,11 +26,13 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.57)
-AC_INIT([xorg-server], 1.5.99.901, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+AC_INIT([xorg-server], 1.5.99.902, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([dist-bzip2 foreign])
 AM_MAINTAINER_MODE
 
+RELEASE_DATE="2009-1-30"
+
 dnl this gets generated by autoheader, and thus contains all the defines.  we
 dnl don't ever actually use it, internally.
 AC_CONFIG_HEADERS(include/do-not-use-config.h)
@@ -417,7 +419,6 @@ VENDOR_MAN_VERSION="Version ${PACKAGE_VERSION}"
 
 VENDOR_NAME="The X.Org Foundation"
 VENDOR_NAME_SHORT="X.Org"
-RELEASE_DATE="(unreleased)"
 VENDOR_WEB="http://wiki.x.org";
 
 m4_ifdef([AS_HELP_STRING], , [m4_define([AS_HELP_STRING], m4_defn([AC_HELP_STRING]))])

commit 56f6fb8c8652c85e522e42557f8969987069076b
Author: Eric Anholt <eric@anholt.net>
Date:   Fri Jan 30 19:06:17 2009 -0800

    randr: Avoid re-querying the configuration on everything but GetScreenResources.
    
    The new path should only re-query on the other requests when we haven't
    gathered the information from the DDX yet (such as with a non-RandR 1.2 DDX).
    
    Bug #19037.
    (cherry picked from commit 317f2b4a9fe4b606975711bc332166a82db5087d)

diff --git a/randr/randrstr.h b/randr/randrstr.h
index b5cebdc..9c9b7c0 100644
--- a/randr/randrstr.h
+++ b/randr/randrstr.h
@@ -468,7 +468,7 @@ RRTellChanged (ScreenPtr pScreen);
  * Poll the driver for changed information
  */
 Bool
-RRGetInfo (ScreenPtr pScreen);
+RRGetInfo (ScreenPtr pScreen, Bool force_query);
 
 Bool RRInit (void);
 
diff --git a/randr/rrinfo.c b/randr/rrinfo.c
index 38314de..12b9a4a 100644
--- a/randr/rrinfo.c
+++ b/randr/rrinfo.c
@@ -178,12 +178,20 @@ RRScanOldConfig (ScreenPtr pScreen, Rotation rotations)
  * Poll the driver for changed information
  */
 Bool
-RRGetInfo (ScreenPtr pScreen)
+RRGetInfo (ScreenPtr pScreen, Bool force_query)
 {
     rrScrPriv (pScreen);
     Rotation	    rotations;
     int		    i;
 
+    /* Return immediately if we don't need to re-query and we already have the
+     * information.
+     */
+    if (!force_query) {
+	if (pScrPriv->numCrtcs != 0 || pScrPriv->numOutputs != 0)
+	    return TRUE;
+    }
+
     for (i = 0; i < pScrPriv->numOutputs; i++)
 	pScrPriv->outputs[i]->changed = FALSE;
     for (i = 0; i < pScrPriv->numCrtcs; i++)
diff --git a/randr/rrscreen.c b/randr/rrscreen.c
index 95662c9..da633b2 100644
--- a/randr/rrscreen.c
+++ b/randr/rrscreen.c
@@ -224,7 +224,7 @@ ProcRRGetScreenSizeRange (ClientPtr client)
     
     if (pScrPriv) 
     {
-	if (!RRGetInfo (pScreen))
+	if (!RRGetInfo (pScreen, FALSE))
 	    return BadAlloc;
 	rep.minWidth  = pScrPriv->minWidth;
 	rep.minHeight = pScrPriv->minHeight;
@@ -340,7 +340,7 @@ rrGetScreenResources(ClientPtr client, Bool query)
     rep.pad = 0;
     
     if (query && pScrPriv)
-	if (!RRGetInfo (pScreen))
+	if (!RRGetInfo (pScreen, query))
 	    return BadAlloc;
 
     if (!pScrPriv)
@@ -615,7 +615,7 @@ ProcRRGetScreenInfo (ClientPtr client)
     rep.pad = 0;
     
     if (pScrPriv)
-	if (!RRGetInfo (pScreen))
+	if (!RRGetInfo (pScreen, FALSE))
 	    return BadAlloc;
 
     output = RRFirstOutput (pScreen);
@@ -796,7 +796,7 @@ ProcRRSetScreenConfig (ClientPtr client)
 	rep.status = RRSetConfigFailed;
 	goto sendReply;
     }
-    if (!RRGetInfo (pScreen))
+    if (!RRGetInfo (pScreen, FALSE))
 	return BadAlloc;
     
     output = RRFirstOutput (pScreen);
diff --git a/randr/rrxinerama.c b/randr/rrxinerama.c
index 7f9a798..36135c6 100644
--- a/randr/rrxinerama.c
+++ b/randr/rrxinerama.c
@@ -307,12 +307,8 @@ ProcRRXineramaQueryScreens(ClientPtr client)
     REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
 
     if (RRXineramaScreenActive (pScreen))
-    {
-	rrScrPriv(pScreen);
-	if (pScrPriv->numCrtcs == 0 || pScrPriv->numOutputs == 0)
-	    RRGetInfo (pScreen);
-    }
-    
+	RRGetInfo (pScreen, FALSE);
+
     rep.type = X_Reply;
     rep.sequenceNumber = client->sequence;
     rep.number = RRXineramaScreenCount (pScreen);

commit 6d928aa227b12832dd358619722a5f4dc71b5d19
Author: Keith Packard <keithp@keithp.com>
Date:   Fri Jan 30 20:17:10 2009 -0800

    RandR crtcs not fetched correctly when primary output is set.
    
    Primary outputs may not have a CRTC.
    Loops fetching CRTCs respecting primary output were broken.
    
    Signed-off-by: Keith Packard <keithp@keithp.com>
    (cherry picked from commit 4de5705545792d77c9990bbec3e263a517757a2a)

diff --git a/randr/randr.c b/randr/randr.c
index 2e482f0..6fe9b56 100644
--- a/randr/randr.c
+++ b/randr/randr.c
@@ -438,7 +438,7 @@ RRFirstOutput (ScreenPtr pScreen)
     RROutputPtr		    output;
     int	i, j;
     
-    if (pScrPriv->primaryOutput)
+    if (pScrPriv->primaryOutput && pScrPriv->primaryOutput->crtc)
 	return pScrPriv->primaryOutput;
 
     for (i = 0; i < pScrPriv->numCrtcs; i++)
diff --git a/randr/rrscreen.c b/randr/rrscreen.c
index 9b1024e..95662c9 100644
--- a/randr/rrscreen.c
+++ b/randr/rrscreen.c
@@ -324,7 +324,7 @@ rrGetScreenResources(ClientPtr client, Bool query)
     rrScrPrivPtr		pScrPriv;
     CARD8			*extra;
     unsigned long		extraLen;
-    int				i, n, rc, has_primary;
+    int				i, n, rc, has_primary = 0;
     RRCrtc			*crtcs;
     RROutput			*outputs;
     xRRModeInfo			*modeinfos;
@@ -402,19 +402,22 @@ rrGetScreenResources(ClientPtr client, Bool query)
 	modeinfos = (xRRModeInfo *) (outputs + pScrPriv->numOutputs);
 	names = (CARD8 *) (modeinfos + num_modes);
 
-	has_primary = (pScrPriv->primaryOutput != NULL);
-	if (pScrPriv->primaryOutput)
+	if (pScrPriv->primaryOutput && pScrPriv->primaryOutput->crtc)
 	{
-	    crtcs[0] = pScrPriv->primaryOutput->id;
+	    has_primary = 1;
+	    crtcs[0] = pScrPriv->primaryOutput->crtc->id;
 	    if (client->swapped)
 		swapl (&crtcs[0], n);
 	}
 	
 	for (i = 0; i < pScrPriv->numCrtcs; i++)
 	{
-	    if (pScrPriv->primaryOutput &&
+	    if (has_primary &&
 		pScrPriv->primaryOutput->crtc == pScrPriv->crtcs[i])
+	    {
+		has_primary = 0;
 		continue;
+	    }
 	    crtcs[i + has_primary] = pScrPriv->crtcs[i]->id;
 	    if (client->swapped)
 		swapl (&crtcs[i + has_primary], n);
diff --git a/randr/rrxinerama.c b/randr/rrxinerama.c
index 5af6fb0..7f9a798 100644
--- a/randr/rrxinerama.c
+++ b/randr/rrxinerama.c
@@ -328,16 +328,21 @@ ProcRRXineramaQueryScreens(ClientPtr client)
     if(rep.number) {
 	rrScrPriv(pScreen);
 	int i;
-	int has_primary = (pScrPriv->primaryOutput != NULL);
+	int has_primary = 0;
 
-	if (has_primary) {
+	if (pScrPriv->primaryOutput && pScrPriv->primaryOutput->crtc) {
+	    has_primary = 1;
 	    RRXineramaWriteCrtc(client, pScrPriv->primaryOutput->crtc);
 	}
 
 	for(i = 0; i < pScrPriv->numCrtcs; i++) {
-	    RRCrtcPtr	crtc = pScrPriv->crtcs[i];
-	    if (!has_primary || (crtc != pScrPriv->primaryOutput->crtc))
-		RRXineramaWriteCrtc(client, crtc);
+	    if (has_primary &&
+		pScrPriv->primaryOutput->crtc == pScrPriv->crtcs[i])
+	    {
+		has_primary = 0;
+		continue;
+	    }
+	    RRXineramaWriteCrtc(client, pScrPriv->crtcs[i]);
 	}
     }
 

commit 759ed0679a030f502b74a6ff44c15d1c97d9a937
Author: Keith Packard <keithp@keithp.com>
Date:   Fri Jan 30 19:14:36 2009 -0800

    RandR SetOutputPrimary should work with or without a crtc connected
    
    The test was inverted from the protocol spec, and besides, the test is bogus
    anyways.
    
    Signed-off-by: Keith Packard <keithp@keithp.com>
    (cherry picked from commit c1f2be1f3fd0c80cb4c85b98140b98aa9311242b)

diff --git a/randr/rroutput.c b/randr/rroutput.c
index 82c2530..939c14d 100644
--- a/randr/rroutput.c
+++ b/randr/rroutput.c
@@ -588,11 +588,6 @@ ProcRRSetOutputPrimary(ClientPtr client)
 	    return RRErrorBase + BadRROutput;
 	}
 
-	if (output->crtc) {
-	    client->errorValue = stuff->output;
-	    return BadMatch;
-	}
-
 	if (output->pScreen != pWin->drawable.pScreen) {
 	    client->errorValue = stuff->window;
 	    return BadMatch;

commit b893dc59da9f5a7afb59ea0b2cd794872fc5727f
Author: Thomas Jaeger <ThJaeger@gmail.com>
Date:   Sat Dec 20 16:17:02 2008 +0100

    Don't release grabs unless all buttons are up
    
    Previously, only buttons <= 5 would count here, but the core protocol
    allows for 255 buttons.
    
    http://lists.freedesktop.org/archives/xorg/2009-January/042092.html
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit 717a961528ec69a6e630d536e15568670e0b398a)
    
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/Xi/exevents.c b/Xi/exevents.c
index b4359a8..482041f 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -1069,7 +1069,7 @@ ProcessOtherEvent(xEventPtr xE, DeviceIntPtr device, int count)
 	    xE->u.u.detail = key;
 	    return;
 	}
-        if (!b->state && device->deviceGrab.fromPassiveGrab)
+        if (!b->buttonsDown && device->deviceGrab.fromPassiveGrab)
             deactivateDeviceGrab = TRUE;
     }
 
diff --git a/dix/events.c b/dix/events.c
index 768a33e..6743cae 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -3848,7 +3848,7 @@ ProcessPointerEvent (xEvent *xE, DeviceIntPtr mouse, int count)
 	    if (xE->u.u.detail == 0)
 		return;
             filters[mouse->id][Motion_Filter(butc)] = MotionNotify;
-	    if (!butc->state && mouse->deviceGrab.fromPassiveGrab)
+	    if (!butc->buttonsDown && mouse->deviceGrab.fromPassiveGrab)
 		deactivateGrab = TRUE;
 	    break;
 	default:

commit 191161a24a80dc553b11f829c12cfffb76ec7185
Author: Thomas Jaeger <ThJaeger@gmail.com>
Date:   Mon Dec 22 00:55:09 2008 +0100

    Count the number of logically down buttons in buttonsDown
    
    This fixes the following bug.  Assuming your window manager grabs
    Alt+Button1 to move windows, map Button3 to 0 via XSetPointerMapping,
    then press the physical button 3 (this shouldn't have any effect), press
    Alt and then button 1.  The press event is delivered to the application
    instead of firing the grab.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit f7f85f696570541e2dd43462675de9e6ee46f545)

diff --git a/Xi/exevents.c b/Xi/exevents.c
index 2aa3161..b4359a8 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -895,10 +895,10 @@ UpdateDeviceState(DeviceIntPtr device, xEvent* xE, int count)
         *kptr |= bit;
 	if (device->valuator)
 	    device->valuator->motionHintWindow = NullWindow;
-        b->buttonsDown++;
-	b->motionMask = DeviceButtonMotionMask;
         if (!b->map[key])
             return DONT_PROCESS;
+        b->buttonsDown++;
+	b->motionMask = DeviceButtonMotionMask;
         if (b->map[key] <= 5)
 	    b->state |= (Button1Mask >> 1) << b->map[key];
 	SetMaskForEvent(device->id, Motion_Filter(b), DeviceMotionNotify);
@@ -927,10 +927,10 @@ UpdateDeviceState(DeviceIntPtr device, xEvent* xE, int count)
         *kptr &= ~bit;
 	if (device->valuator)
 	    device->valuator->motionHintWindow = NullWindow;
-        if (b->buttonsDown >= 1 && !--b->buttonsDown)
-	    b->motionMask = 0;
         if (!b->map[key])
             return DONT_PROCESS;
+        if (b->buttonsDown >= 1 && !--b->buttonsDown)
+	    b->motionMask = 0;
 	if (b->map[key] <= 5)
 	    b->state &= ~((Button1Mask >> 1) << b->map[key]);
 	SetMaskForEvent(device->id, Motion_Filter(b), DeviceMotionNotify);
diff --git a/include/inputstr.h b/include/inputstr.h
index 4719d37..a6f823c 100644
--- a/include/inputstr.h
+++ b/include/inputstr.h
@@ -185,7 +185,11 @@ typedef struct _ValuatorClassRec {
 
 typedef struct _ButtonClassRec {
     CARD8		numButtons;
-    CARD8		buttonsDown;	/* number of buttons currently down */
+    CARD8		buttonsDown;	/* number of buttons currently down
+                                           This counts logical buttons, not
+					   physical ones, i.e if some buttons
+					   are mapped to 0, they're not counted
+					   here */
     unsigned short	state;
     Mask		motionMask;
     CARD8		down[DOWN_LENGTH];

commit fe0abdceb483ec0bb2977016b00aef57033aa449
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Thu Jan 8 11:53:30 2009 +1000

    mi: ensure chained button mappings from SD -> MD (#19282)
    
    After copying the master event, flip the detail field to the mapped button of
    the SD, not the physical button. This way if the SD has a mapping 1:3 and the
    MD has a mapping of 3:4, a press on button 1 on the SD results in a core event
    on button 4.
    
    X.Org Bug 19282 <http://bugs.freedesktop.org/show_bug.cgi?id=19282>
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/mi/mi.h b/mi/mi.h
index 444d3ad..6e8b89e 100644
--- a/mi/mi.h
+++ b/mi/mi.h
@@ -175,6 +175,10 @@ extern void mieqProcessInputEvents(
 typedef void (*mieqHandler)(int, xEventPtr, DeviceIntPtr, int);
 void mieqSetHandler(int event, mieqHandler handler);
 
+void
+CopyGetMasterEvent(DeviceIntPtr mdev, DeviceIntPtr sdev, xEvent* original,
+                   EventListPtr master, int count);
+
 /* miexpose.c */
 
 extern RegionPtr miHandleExposures(
diff --git a/mi/mieq.c b/mi/mieq.c
index 8d68ca1..226caa6 100644
--- a/mi/mieq.c
+++ b/mi/mieq.c
@@ -327,15 +327,32 @@ ChangeDeviceID(DeviceIntPtr dev, xEvent* event)
         DebugF("[mi] Unknown event type (%d), cannot change id.\n", type);
 }
 
+static void
+FixUpEventForMaster(DeviceIntPtr mdev, DeviceIntPtr sdev, xEvent* original,
+                    EventListPtr master, int count)
+{
+    /* Ensure chained button mappings, i.e. that the detail field is the
+     * value of the mapped button on the SD, not the physical button */
+    if (original->u.u.type == DeviceButtonPress || original->u.u.type == DeviceButtonRelease)
+    {
+        int btn = original->u.u.detail;
+        if (!sdev->button)
+            return; /* Should never happen */
+
+        master->event->u.u.detail = sdev->button->map[btn];
+    }
+}
+
 /**
  * Copy the given event into master.
  * @param mdev The master device
+ * @param sdev The slave device the original event comes from
  * @param original The event as it came from the EQ
  * @param master The event after being copied
  * @param count Number of events in original.
  */
 void
-CopyGetMasterEvent(DeviceIntPtr mdev, xEvent* original,
+CopyGetMasterEvent(DeviceIntPtr mdev, DeviceIntPtr sdev, xEvent* original,
                    EventListPtr master, int count)
 {
     int len = count * sizeof(xEvent);
@@ -350,11 +367,16 @@ CopyGetMasterEvent(DeviceIntPtr mdev, xEvent* original,
 
     memcpy(master->event, original, len);
     while (count--)
+    {
         ChangeDeviceID(mdev, &master->event[count]);
+        FixUpEventForMaster(mdev, sdev, original, master, count);
+    }
 }
 extern void
 CopyKeyClass(DeviceIntPtr device, DeviceIntPtr master);
 
+
+
 /* Call this from ProcessInputEvents(). */
 void
 mieqProcessInputEvents(void)
@@ -431,7 +453,7 @@ mieqProcessInputEvents(void)
                     event->u.u.type == DeviceKeyRelease)
 		    CopyKeyClass(dev, master);
 
-                CopyGetMasterEvent(master, event, masterEvents, nevents);
+                CopyGetMasterEvent(master, dev, event, masterEvents, nevents);
             }
 
             /* If someone's registered a custom event handler, let them
diff --git a/xkb/ddxDevBtn.c b/xkb/ddxDevBtn.c
index 585ad19..44ee75f 100644
--- a/xkb/ddxDevBtn.c
+++ b/xkb/ddxDevBtn.c
@@ -117,7 +117,7 @@ DeviceIntPtr		master = NULL;
         if (!IsPointerDevice(master))
             master = GetPairedDevice(dev->u.master);
 
-        CopyGetMasterEvent(master, &events, masterEvents, count);
+        CopyGetMasterEvent(master, dev, &events, masterEvents, count);
     }
 
     (*dev->public.processInputProc)((xEventPtr)btn, dev, count);

commit 3441917008021fb13cf86fa619970859d927e17a
Author: Thomas Jaeger <thjaeger@gmail.com>
Date:   Mon Jan 5 01:26:42 2009 -0500

    Don't alter device button maps in DoSetPointerMapping
    
    Currently, if a device map differs from the core pointer map, then the
    request may return MappingBusy, even though all the affected core
    buttons are in the up state.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit 3d549438c29004d78032ecc50ab45ca0e3f49623)

diff --git a/dix/devices.c b/dix/devices.c
index 47e07f9..0858f20 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -1831,36 +1831,23 @@ static int
 DoSetPointerMapping(ClientPtr client, DeviceIntPtr device, BYTE *map, int n)
 {
     int rc, i = 0;
-    DeviceIntPtr dev = NULL;
 
     if (!device || !device->button)
         return BadDevice;
 
-    for (dev = inputInfo.devices; dev; dev = dev->next) {
-        if ((dev->coreEvents || dev == inputInfo.pointer) && dev->button) {
-	    rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixManageAccess);
-	    if (rc != Success)
-		return rc;
-	}
-    }
+    rc = XaceHook(XACE_DEVICE_ACCESS, client, device, DixManageAccess);
+    if (rc != Success)
+        return rc;
 
-    for (dev = inputInfo.devices; dev; dev = dev->next) {
-        if ((dev->coreEvents || dev == inputInfo.pointer) && dev->button) {
-            for (i = 0; i < n; i++) {
-                if ((device->button->map[i + 1] != map[i]) &&
-                        BitIsOn(device->button->down, i + 1)) {
-                    return MappingBusy;
-                }
-            }
+    for (i = 0; i < n; i++) {
+        if ((device->button->map[i + 1] != map[i]) &&
+            BitIsOn(device->button->down, i + 1)) {
+            return MappingBusy;
         }
     }
 
-    for (dev = inputInfo.devices; dev; dev = dev->next) {
-        if ((dev->coreEvents || dev == inputInfo.pointer) && dev->button) {
-            for (i = 0; i < n; i++)
-                dev->button->map[i + 1] = map[i];
-        }
-    }
+    for (i = 0; i < n; i++)
+        device->button->map[i + 1] = map[i];
 
     return Success;
 }
@@ -1917,7 +1904,6 @@ ProcSetPointerMapping(ClientPtr client)
         return Success;
     }
 
-    /* FIXME: Send mapping notifies for all the extended devices as well. */
     SendMappingNotify(ptr, MappingPointer, 0, 0, client);
     WriteReplyToClient(client, sizeof(xSetPointerMappingReply), &rep);
     return Success;

commit 364bcbea48d5e49bef8d36f6724e2702cbb4b1af
Author: Thomas Jaeger <ThJaeger@gmail.com>
Date:   Fri Jan 9 02:02:38 2009 -0500

    Xext: Send out correct events in ProcXTestFakeInput
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit b2756a71a432f7cf7c870a48676c98625512558d)

diff --git a/Xext/xtest.c b/Xext/xtest.c
index 1290a23..a7f3830 100644
--- a/Xext/xtest.c
+++ b/Xext/xtest.c
@@ -396,7 +396,7 @@ ProcXTestFakeInput(client)
 
     OsBlockSignals();
     for (i = 0; i < nevents; i++)
-        mieqEnqueue(dev, events->event);
+        mieqEnqueue(dev, (events+i)->event);
     OsReleaseSignals();
 
     return client->noClientException;

commit e789789196db8271a83c751fdf990ceb70164cb1
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Mon Jan 5 15:48:45 2009 +1000

    xkb: fix typo - missing negation when checking button state.
    
    Introduced with a85f0d6b98237d8a196de624207acf1983a1859a.
    
    Reported by Thomas Jaeger.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit 515ce3e4ba42605a1ee9979e8bb5acd3cf6470a3)

diff --git a/xkb/xkbActions.c b/xkb/xkbActions.c
index 64e17e9..aea479c 100644
--- a/xkb/xkbActions.c
+++ b/xkb/xkbActions.c
@@ -1075,7 +1075,7 @@ int		button;
 	switch (filter->upAction.type) {
 	    case XkbSA_LockDeviceBtn:
 		if ((filter->upAction.devbtn.flags&XkbSA_LockNoUnlock)||
-		    BitIsOn(dev->button->down, button))
+		    !BitIsOn(dev->button->down, button))
 		    return 0;
 		XkbDDXFakeDeviceButton(dev,False,button);
 		break;

commit ebb3872925315d705e47e1ccd7f193ac90ac33dc
Author: Peter Hutterer <peter.hutterer@redhat.com>
Date:   Wed Nov 26 11:15:05 2008 +1000

    Xi: fix use of button->down - bitflags instead of int arrays.
    
    The device's button down state array was changed to use DOWN_LENGTH and thus
    bitflags for each button in cfcb3da7.
    
    Update the DBSN events to copy this bit-wise state.
    Update xkb and Xi to check for the bit flag instead of the array value.
    
    Reported by ajax.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
    (cherry picked from commit a85f0d6b98237d8a196de624207acf1983a1859a)

diff --git a/Xi/exevents.c b/Xi/exevents.c
index 083bb2f..2aa3161 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -1138,11 +1138,9 @@ FixDeviceStateNotify(DeviceIntPtr dev, deviceStateNotify * ev, KeyClassPtr k,
     ev->num_valuators = 0;
 
     if (b) {
-	int i;
 	ev->classes_reported |= (1 << ButtonClass);
 	ev->num_buttons = b->numButtons;
-	for (i = 0; i < 32; i++)
-	    SetBitIf(ev->buttons, b->down, i);
+	memcpy((char*)ev->buttons, (char*)b->down, 4);
     } else if (k) {
 	ev->classes_reported |= (1 << KeyClass);
 	ev->num_keys = k->curKeySyms.maxKeyCode - k->curKeySyms.minKeyCode;
@@ -1257,13 +1255,11 @@ DeviceFocusEvent(DeviceIntPtr dev, int type, int mode, int detail,
 	    first += 3;
 	    nval -= 3;
 	    if (nbuttons > 32) {
-		int i;
 		(ev - 1)->deviceid |= MORE_EVENTS;
 		bev = (deviceButtonStateNotify *) ev++;
 		bev->type = DeviceButtonStateNotify;
 		bev->deviceid = dev->id;
-		for (i = 32; i < MAP_LENGTH; i++)
-		    SetBitIf(bev->buttons, b->down, i);
+		memcpy((char*)&bev->buttons[4], (char*)&b->down[4], DOWN_LENGTH - 4);
 	    }
 	    if (nval > 0) {
 		(ev - 1)->deviceid |= MORE_EVENTS;
@@ -1678,7 +1674,7 @@ SetButtonMapping(ClientPtr client, DeviceIntPtr dev, int nElts, BYTE * map)
     if (BadDeviceMap(&map[0], nElts, 1, 255, &client->errorValue))
 	return BadValue;
     for (i = 0; i < nElts; i++)
-	if ((b->map[i + 1] != map[i]) && (b->down[i + 1]))
+	if ((b->map[i + 1] != map[i]) && BitIsOn(b->down, i + 1))
 	    return MappingBusy;
     for (i = 0; i < nElts; i++)
 	b->map[i + 1] = map[i];
diff --git a/Xi/queryst.c b/Xi/queryst.c
index 268bdd7..21de843 100644
--- a/Xi/queryst.c
+++ b/Xi/queryst.c
@@ -139,8 +139,7 @@ ProcXQueryDeviceState(ClientPtr client)
 	tb->class = ButtonClass;
 	tb->length = sizeof(xButtonState);
 	tb->num_buttons = b->numButtons;
-	for (i = 0; i < MAP_LENGTH; i++)
-            SetBitIf(tb->buttons, b->down, i);
+	memcpy(tb->buttons, b->down, sizeof(b->down));
 	buf += sizeof(xButtonState);
     }
 
diff --git a/dix/devices.c b/dix/devices.c
index bf79024..47e07f9 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -1848,7 +1848,7 @@ DoSetPointerMapping(ClientPtr client, DeviceIntPtr device, BYTE *map, int n)
         if ((dev->coreEvents || dev == inputInfo.pointer) && dev->button) {
             for (i = 0; i < n; i++) {
                 if ((device->button->map[i + 1] != map[i]) &&
-                        device->button->down[i + 1]) {
+                        BitIsOn(device->button->down, i + 1)) {
                     return MappingBusy;
                 }
             }
diff --git a/include/inputstr.h b/include/inputstr.h
index 9591d2f..4719d37 100644
--- a/include/inputstr.h
+++ b/include/inputstr.h
@@ -57,9 +57,6 @@ SOFTWARE.
 #include "privates.h"
 
 #define BitIsOn(ptr, bit) (((BYTE *) (ptr))[(bit)>>3] & (1 << ((bit) & 7)))
-/* If byte[i] in src is non-zero, set bit i in dst, otherwise set bit to 0 */
-#define SetBitIf(dst, src, i) \
-    (src[i]) ? (dst[i/8] |= (1 << (i % 8))) : (dst[i/8] &= ~(1 << (i % 8)));
 
 #define SameClient(obj,client) \
 	(CLIENT_BITS((obj)->resource) == (client)->clientAsMask)
diff --git a/xkb/xkbActions.c b/xkb/xkbActions.c
index 94420cf..64e17e9 100644
--- a/xkb/xkbActions.c
+++ b/xkb/xkbActions.c
@@ -1043,7 +1043,7 @@ int		button;
 	switch (pAction->type) {
 	    case XkbSA_LockDeviceBtn:
 		if ((pAction->devbtn.flags&XkbSA_LockNoLock)||
-		    (dev->button->down[button]))
+		    BitIsOn(dev->button->down, button))
 		    return 0;
 		XkbDDXFakeDeviceButton(dev,True,button);
 		filter->upAction.type= XkbSA_NoAction;
@@ -1075,7 +1075,7 @@ int		button;
 	switch (filter->upAction.type) {
 	    case XkbSA_LockDeviceBtn:
 		if ((filter->upAction.devbtn.flags&XkbSA_LockNoUnlock)||
-		    ((dev->button->down[button])==0))
+		    BitIsOn(dev->button->down, button))
 		    return 0;
 		XkbDDXFakeDeviceButton(dev,False,button);
 		break;

commit 50d80c25525a691472e3fc5859fb303a3ffe1ef2
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Mon Jan 12 15:29:36 2009 +1000

    dix: fix WarpPointer calls for devices with custom valuator ranges (#19297)
    
    If the MD's lastSlave was a devices with custom axes ranges, then a
    WarpPointer would position the cursor at the wrong location. A WarpPointer
    request provides screen coordinates and these coordinates were scaled to the
    device range before warping.
    
    This patch consists of two parts:
    1) in the WarpPointer handling, get the lastSlave and post the event through
       this device.
    2) assume that WarpPointer coordinates are always in screen coordinates and
       scale them to device coordinates in GPE before continuing. Note that this
       breaks device-coordinate based XWarpDevicePointer calls (for which the spec
       isn't nailed down yet anyway) until a better solution is found.
    
    X.Org Bug 19297 <http://bugs.freedesktop.org/show_bug.cgi?id=19297>
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit d36adf52a2b2711d22b11105f7bd907d4493fb9b)

diff --git a/dix/events.c b/dix/events.c
index 498616f..768a33e 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -3073,8 +3073,8 @@ ProcWarpPointer(ClientPtr client)
     WindowPtr	dest = NULL;
     int		x, y, rc;
     ScreenPtr	newScreen;
-    DeviceIntPtr dev = PickPointer(client);
-    SpritePtr   pSprite = dev->spriteInfo->sprite;
+    DeviceIntPtr dev;
+    SpritePtr   pSprite;
 
     REQUEST(xWarpPointerReq);
     REQUEST_SIZE_MATCH(xWarpPointerReq);
@@ -3087,6 +3087,12 @@ ProcWarpPointer(ClientPtr client)
 		return rc;
 	}
     }
+
+    dev = PickPointer(client);
+    if (dev->u.lastSlave)
+        dev = dev->u.lastSlave;
+    pSprite = dev->spriteInfo->sprite;
+
 #ifdef PANORAMIX
     if(!noPanoramiXExtension)
 	return XineramaWarpPointer(client);
@@ -3153,13 +3159,12 @@ ProcWarpPointer(ClientPtr client)
 	else if (y >= pSprite->physLimits.y2)
 	    y = pSprite->physLimits.y2 - 1;
 	if (pSprite->hotShape)
-	    ConfineToShape(PickPointer(client), pSprite->hotShape, &x, &y);
-        (*newScreen->SetCursorPosition)(PickPointer(client), newScreen, x, y,
-                                        TRUE);
+	    ConfineToShape(dev, pSprite->hotShape, &x, &y);
+        (*newScreen->SetCursorPosition)(dev, newScreen, x, y, TRUE);
     }
-    else if (!PointerConfinedToScreen(PickPointer(client)))
+    else if (!PointerConfinedToScreen(dev))
     {
-	NewCurrentScreen(PickPointer(client), newScreen, x, y);
+	NewCurrentScreen(dev, newScreen, x, y);
     }
     return Success;
 }
diff --git a/dix/getevents.c b/dix/getevents.c
index 16e23dc..279f49e 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -973,8 +973,20 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons,
     events = updateFromMaster(events, pDev, &num_events);
 
     if (flags & POINTER_ABSOLUTE)
+    {
+        if (flags & POINTER_SCREEN) /* valuators are in screen coords */
+        {
+
+            valuators[0] = rescaleValuatorAxis(valuators[0], NULL,
+                                               pDev->valuator->axes + 0,
+                                               scr->width);
+            valuators[1] = rescaleValuatorAxis(valuators[1], NULL,
+                                               pDev->valuator->axes + 1,
+                                               scr->height);
+        }
+
         moveAbsolute(pDev, &x, &y, first_valuator, num_valuators, valuators);
-    else {
+    } else {
         if (flags & POINTER_ACCELERATE)
             accelPointer(pDev, first_valuator, num_valuators, valuators, ms);
         moveRelative(pDev, &x, &y, first_valuator, num_valuators, valuators);
diff --git a/include/input.h b/include/input.h
index cf7f824..2ab815b 100644
--- a/include/input.h
+++ b/include/input.h
@@ -62,6 +62,7 @@ SOFTWARE.
 #define POINTER_RELATIVE (1 << 1)
 #define POINTER_ABSOLUTE (1 << 2)
 #define POINTER_ACCELERATE (1 << 3)
+#define POINTER_SCREEN (1 << 4) /* Data in screen coordinates */
 
 /*int constants for pointer acceleration schemes*/
 #define PtrAccelNoOp            0
diff --git a/mi/mipointer.c b/mi/mipointer.c
index 9b2a1b2..8c8af6e 100644
--- a/mi/mipointer.c
+++ b/mi/mipointer.c
@@ -576,7 +576,7 @@ miPointerMove (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
         }
     }
 
-    nevents = GetPointerEvents(events, pDev, MotionNotify, 0, POINTER_ABSOLUTE, 0, 2, valuators);
+    nevents = GetPointerEvents(events, pDev, MotionNotify, 0, POINTER_SCREEN | POINTER_ABSOLUTE, 0, 2, valuators);
 
     OsBlockSignals();
 #ifdef XQUARTZ

commit b19f12712a0762f20065282fd055fe9bc3ca975f
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Mon Jan 12 16:16:24 2009 +1000

    dix: EnqueueEvent and PlayReleasedEvent need to handle DeviceMotionNotifies
    
    No MotionNotify events in the processing anymore, so let's have them treat DMN
    instead.
    
    Reported by Thomas Jaeger.
    (cherry picked from commit 488d45295105daf10ccd17ca93ae6a6f4d0104f1)

diff --git a/dix/events.c b/dix/events.c
index 122ce6a..498616f 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -1160,14 +1160,14 @@ EnqueueEvent(xEvent *xE, DeviceIntPtr device, int count)
 	 *  the data that GetCurrentRootWindow relies on hasn't been
 	 *  updated yet.
 	 */
-	if (xE->u.u.type == MotionNotify)
+	if (xE->u.u.type == DeviceMotionNotify)
 	    XE_KBPTR.root =
 		WindowTable[pSprite->hotPhys.pScreen->myNum]->drawable.id;
 	eventinfo.events = xE;
 	eventinfo.count = count;
 	CallCallbacks(&DeviceEventCallback, (pointer)&eventinfo);
     }
-    if (xE->u.u.type == MotionNotify)
+    if (xE->u.u.type == DeviceMotionNotify)
     {
 #ifdef PANORAMIX
 	if(!noPanoramiXExtension) {
@@ -1181,7 +1181,7 @@ EnqueueEvent(xEvent *xE, DeviceIntPtr device, int count)
 	pSprite->hotPhys.y = XE_KBPTR.rootY;
 	/* do motion compression, but not if from different devices */
 	if (tail &&
-	    (tail->event->u.u.type == MotionNotify) &&
+	    (tail->event->u.u.type == DeviceMotionNotify) &&
             (tail->device == device) &&
 	    (tail->pScreen == pSprite->hotPhys.pScreen))
 	{
@@ -1248,7 +1248,7 @@ PlayReleasedEvents(void)
             pDev = qe->device;
 	    if (*syncEvents.pendtail == *prev)
 		syncEvents.pendtail = prev;
-	    if (qe->event->u.u.type == MotionNotify)
+	    if (qe->event->u.u.type == DeviceMotionNotify)
 		CheckVirtualMotion(pDev, qe, NullWindow);
 	    syncEvents.time.months = qe->months;
             /* XXX: Hack! We can't reliably get the time from GenericEvents,

commit ef796a95dd7ddf4ad5761a6ee2de1cdb56190ba2
Author: Xiang, Haihao <haihao.xiang@intel.com>
Date:   Tue Jan 6 10:03:19 2009 +0800

    avoid a potential endless loop.
    
    Previously it is possible that creating rotation data, then cleaning
    up and creating again so that pScreen->BlockHandler and
    xf86_config->BlockHandler all point to xf86RotateBlockHandler.
    See bug #19343.
    (cherry picked from commit 5f3188228eb988bd8f08b62c84f98a8ff66ee283)

diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c
index 65a553e..f9f43c9 100644
--- a/hw/xfree86/modes/xf86Rotate.c
+++ b/hw/xfree86/modes/xf86Rotate.c
@@ -291,6 +291,8 @@ xf86RotateBlockHandler(int screenNum, pointer blockData,
 	/* Re-wrap if rotation is still happening */
 	xf86_config->BlockHandler = pScreen->BlockHandler;
 	pScreen->BlockHandler = xf86RotateBlockHandler;
+    } else {
+	xf86_config->BlockHandler = NULL;
     }
 }
 
@@ -477,8 +479,10 @@ xf86CrtcRotate (xf86CrtcPtr crtc)
 		goto bail2;
 	    
 	    /* Wrap block handler */
-	    xf86_config->BlockHandler = pScreen->BlockHandler;
-	    pScreen->BlockHandler = xf86RotateBlockHandler;
+	    if (!xf86_config->BlockHandler) {
+		xf86_config->BlockHandler = pScreen->BlockHandler;
+		pScreen->BlockHandler = xf86RotateBlockHandler;
+	    }


Reply to: