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

xorg-server: Changes to 'upstream-unstable'



Rebased ref, commits from common ancestor:
commit 38e73f7fc29fe8e9defa8a0516a50ac3a84e10c2
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date:   Fri Apr 13 15:44:08 2012 -0700

    configure.ac: Bump to 1.12.1
    
    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>

diff --git a/configure.ac b/configure.ac
index b26da71..a12783c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,8 +26,8 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.60)
-AC_INIT([xorg-server], 1.12.0.902, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2012-04-09"
+AC_INIT([xorg-server], 1.12.1, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2012-04-13"
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
 AM_MAINTAINER_MODE

commit d603515dbfef94ec9cf7f5538815a954511e9e70
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date:   Mon Apr 9 19:37:31 2012 -0700

    configure.ac: Bump to 1.12.0.902 (1.12.1 RC2)
    
    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>

diff --git a/configure.ac b/configure.ac
index cc21fd8..b26da71 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,8 +26,8 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.60)
-AC_INIT([xorg-server], 1.12.0.901, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2012-03-30"
+AC_INIT([xorg-server], 1.12.0.902, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2012-04-09"
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
 AM_MAINTAINER_MODE

commit 7e62bc31c65aedcdf55cd7dc02b349b6b5c0812c
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date:   Sat Apr 7 15:26:53 2012 -0700

    test: Fix make dist
    
    I don't know why this fixes the problem with make dist, but it does...
    
    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>

diff --git a/test/Makefile.am b/test/Makefile.am
index eb61470..32be00d 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -53,8 +53,6 @@ libxservertest_la_LIBADD += \
             $(top_builddir)/hw/xfree86/dixmods/libxorgxkb.la \
             @XORG_LIBS@
 
-EXTRA_DIST = ddxstubs.c
-
 else
 nodist_libxservertest_la_SOURCES = \
             ddxstubs.c \
@@ -110,3 +108,6 @@ endif
 
 libxservertest_la_DEPENDENCIES = $(libxservertest_la_LIBADD)
 endif
+
+EXTRA_DIST = ddxstubs.c
+

commit ad89533327919223204021738dd108d7dd814e8c
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date:   Mon Apr 9 19:36:04 2012 -0700

    Revert "xfree86: workaround crash on close"
    
    This reverts commit b704d9146336c3044be2be7ae38ce2c5b5a47f86.
    
    This was causing some regressions.  Reverting as discussed on xorg-devel.

diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c
index f9602fa..85d7557 100644
--- a/hw/xfree86/modes/xf86Rotate.c
+++ b/hw/xfree86/modes/xf86Rotate.c
@@ -272,7 +272,6 @@ xf86RotateDestroy(xf86CrtcPtr crtc)
     ScrnInfoPtr pScrn = crtc->scrn;
     ScreenPtr pScreen = pScrn->pScreen;
     xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
-    DrawablePtr screenDrawable = &pScreen->root->drawable;
     int c;
 
     /* Free memory from rotation */
@@ -290,7 +289,7 @@ xf86RotateDestroy(xf86CrtcPtr crtc)
     /*
      * Clean up damage structures when no crtcs are rotated
      */
-    if (screenDrawable && xf86_config->rotation_damage) {
+    if (xf86_config->rotation_damage) {
         /* Free damage structure */
         if (xf86_config->rotation_damage_registered) {
             DamageUnregister(&pScreen->root->drawable,

commit 259aa5a69b69aa72be3fb7402b68560f9a6b05d6
Author: Chase Douglas <chase.douglas@canonical.com>
Date:   Thu Mar 29 18:06:03 2012 -0700

    Implement passive touch ungrabbing
    
    Whoops. Forgot to implement this. The code currently generates an error
    due to the unhandled grab type.
    
    X.Org Bug 48069 <https://bugs.freedesktop.org/show_bug.cgi?id=48069>
    
    Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
    Signed-off-by: Keith Packard <keithp@keithp.com>
    (cherry picked from commit 1110facdfeb95b1ad47d03c0ca3d73933b86dbd6)

diff --git a/Xi/xipassivegrab.c b/Xi/xipassivegrab.c
index 8a1c599..7130328 100644
--- a/Xi/xipassivegrab.c
+++ b/Xi/xipassivegrab.c
@@ -290,13 +290,15 @@ ProcXIPassiveUngrabDevice(ClientPtr client)
     if (stuff->grab_type != XIGrabtypeButton &&
         stuff->grab_type != XIGrabtypeKeycode &&
         stuff->grab_type != XIGrabtypeEnter &&
-        stuff->grab_type != XIGrabtypeFocusIn) {
+        stuff->grab_type != XIGrabtypeFocusIn &&
+        stuff->grab_type != XIGrabtypeTouchBegin) {
         client->errorValue = stuff->grab_type;
         return BadValue;
     }
 
     if ((stuff->grab_type == XIGrabtypeEnter ||
-         stuff->grab_type == XIGrabtypeFocusIn) && stuff->detail != 0) {
+         stuff->grab_type == XIGrabtypeFocusIn ||
+         stuff->grab_type == XIGrabtypeTouchBegin) && stuff->detail != 0) {
         client->errorValue = stuff->detail;
         return BadValue;
     }
@@ -327,6 +329,9 @@ ProcXIPassiveUngrabDevice(ClientPtr client)
     case XIGrabtypeFocusIn:
         tempGrab->type = XI_FocusIn;
         break;
+    case XIGrabtypeTouchBegin:
+        tempGrab->type = XI_TouchBegin;
+        break;
     }
     tempGrab->grabtype = XI2;
     tempGrab->modifierDevice = mod_dev;

commit 42474e98ec4245c9e80fc0e9a4b287f3999324f2
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date:   Thu Apr 5 14:03:35 2012 -0700

    XQuartz: Automatically start our virtual tablet devices
    
    Fixes: https://bugs.launchpad.net/inkscape/+bug/972914
    Regression introduced by: 7790dc86384cc451ac44663737fde84dd81ad4e1
    
    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
    (cherry picked from commit e9d3848d7bda7f7de4c0f497aee4482d0b30ad49)

diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c
index ff6581c..2d5174a 100644
--- a/hw/xquartz/darwin.c
+++ b/hw/xquartz/darwin.c
@@ -539,15 +539,15 @@ InitInput(int argc, char **argv)
        gdkdev->info.source = GDK_SOURCE_PEN;
      */
 
-    darwinTabletStylus = AddInputDevice(serverClient, DarwinTabletProc, FALSE);
+    darwinTabletStylus = AddInputDevice(serverClient, DarwinTabletProc, TRUE);
     assert(darwinTabletStylus);
     darwinTabletStylus->name = strdup("pen");
 
-    darwinTabletCursor = AddInputDevice(serverClient, DarwinTabletProc, FALSE);
+    darwinTabletCursor = AddInputDevice(serverClient, DarwinTabletProc, TRUE);
     assert(darwinTabletCursor);
     darwinTabletCursor->name = strdup("cursor");
 
-    darwinTabletEraser = AddInputDevice(serverClient, DarwinTabletProc, FALSE);
+    darwinTabletEraser = AddInputDevice(serverClient, DarwinTabletProc, TRUE);
     assert(darwinTabletEraser);
     darwinTabletEraser->name = strdup("eraser");
 

commit 4b3ac1b563c3de32ad13e794fefabd5124648393
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date:   Fri Mar 30 14:29:48 2012 -0700

    XQuartz: Tiger build fix
    
    Fixes: https://trac.macports.org/ticket/33818
    
    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
    (cherry picked from commit 6cb83b78c47b80556cb4d573524d60f0cd1a64ac)

diff --git a/hw/xquartz/mach-startup/Makefile.am b/hw/xquartz/mach-startup/Makefile.am
index 21ad5b5..77962b1 100644
--- a/hw/xquartz/mach-startup/Makefile.am
+++ b/hw/xquartz/mach-startup/Makefile.am
@@ -23,7 +23,7 @@ nodist_X11_bin_SOURCES = \
 	mach_startupServer.c \
 	mach_startupUser.c
 
-X11_bin_LDADD = \
+X11_bin_DEPENDENCIES = \
 	$(top_builddir)/hw/xquartz/libXquartz.la \
 	$(top_builddir)/hw/xquartz/xpr/libXquartzXpr.la \
 	$(top_builddir)/dix/dixfonts.lo \
@@ -31,8 +31,12 @@ X11_bin_LDADD = \
 	$(top_builddir)/hw/xquartz/pbproxy/libxpbproxy.la \
 	$(XQUARTZ_LIBS) $(XSERVER_LIBS)
 
+# $(XSERVER_SYS_LIBS) is placed here in order to set command line ordering
+# to work around build issues on Tiger.
+X11_bin_LDADD = $(X11_bin_DEPENDENCIES) $(XSERVER_SYS_LIBS)
+
 X11_bin_LDFLAGS =  \
-	$(XSERVER_SYS_LIBS) -lXplugin \
+	-lXplugin \
 	-XCClinker -Objc \
 	-Wl,-u,_miDCInitialize \
 	-Wl,-framework,Carbon \
@@ -41,7 +45,7 @@ X11_bin_LDFLAGS =  \
 	-Wl,-framework,IOKit
 
 if GLX
-X11_bin_LDADD += \
+X11_bin_DEPENDENCIES += \
 	$(top_builddir)/hw/xquartz/GL/libCGLCore.la \
 	$(top_builddir)/glx/libglx.la
 
@@ -55,12 +59,10 @@ X11_bin_LDFLAGS += \
 endif
 
 if RECORD
-X11_bin_LDADD += \
+X11_bin_DEPENDENCIES += \
 	$(top_builddir)/record/librecord.la
 endif
 
-X11_bin_DEPENDENCIES = $(X11_bin_LDADD)
-
 bin_PROGRAMS = Xquartz
 
 dist_Xquartz_SOURCES = \

commit b704d9146336c3044be2be7ae38ce2c5b5a47f86
Author: Michal Suchanek <hramrach@gmail.com>
Date:   Wed Mar 28 18:12:39 2012 -0700

    xfree86: workaround crash on close
    
    Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=41653
    
    Signed-off-by: Michal Suchanek <hramrach@gmail.com>
    Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
    (cherry picked from commit 55f552adb651715d2620db7248cd5b9b8187654a)

diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c
index 85d7557..f9602fa 100644
--- a/hw/xfree86/modes/xf86Rotate.c
+++ b/hw/xfree86/modes/xf86Rotate.c
@@ -272,6 +272,7 @@ xf86RotateDestroy(xf86CrtcPtr crtc)
     ScrnInfoPtr pScrn = crtc->scrn;
     ScreenPtr pScreen = pScrn->pScreen;
     xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
+    DrawablePtr screenDrawable = &pScreen->root->drawable;
     int c;
 
     /* Free memory from rotation */
@@ -289,7 +290,7 @@ xf86RotateDestroy(xf86CrtcPtr crtc)
     /*
      * Clean up damage structures when no crtcs are rotated
      */
-    if (xf86_config->rotation_damage) {
+    if (screenDrawable && xf86_config->rotation_damage) {
         /* Free damage structure */
         if (xf86_config->rotation_damage_registered) {
             DamageUnregister(&pScreen->root->drawable,

commit 391f75e87515fcc89b8e5cd058401c4a056d9139
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date:   Fri Mar 30 16:01:57 2012 -0700

    configure.ac: Bump to 1.12.0.901 (1.12.1 RC1)
    
    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>

diff --git a/configure.ac b/configure.ac
index 2693ce7..cc21fd8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,8 +26,8 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.60)
-AC_INIT([xorg-server], 1.12.0, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2012-03-04"
+AC_INIT([xorg-server], 1.12.0.901, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2012-03-30"
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
 AM_MAINTAINER_MODE

commit 5eb20062208177172ff3443e522096a2e8f2f1e8
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Wed Mar 21 14:05:29 2012 +1000

    dix: set raw event values before adding up relative values (#46976)
    
    Regression introduced in 4e52cc0ef48145134cd58d357fb7289e6f8bb709
    
    Raw event values are values as-is from the driver, modified only be
    transformation or acceleration. 4e52cc caused the mask to be updated from
    relative to absolute coordinates which then got written into the raw events.
    
    Move the raw event update into the respective branches for absolute/relative
    events.
    
    X.Org Bug 46976 <http://bugs.freedesktop.org/show_bug.cgi?id=46976>
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
    Reviewed-by: Daniel Stone <daniel@fooishbar.org>
    Tested-by: Sven Arvidsson <sa@whiz.se>
    Reviewed-by: Simon Thum <simon.thum@gmx.de>
    (cherry picked from commit 908ab3d580188533168c8cdfd2cab9dc689b4218)

diff --git a/dix/getevents.c b/dix/getevents.c
index 260955b..fa85fe7 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -1314,18 +1314,19 @@ fill_pointer_events(InternalEvent *events, DeviceIntPtr pDev, int type,
 
         transformAbsolute(pDev, &mask);
         clipAbsolute(pDev, &mask);
+        if ((flags & POINTER_NORAW) == 0)
+            set_raw_valuators(raw, &mask, raw->valuators.data);
     }
     else {
         if (flags & POINTER_ACCELERATE)
             accelPointer(pDev, &mask, ms);
+        if ((flags & POINTER_NORAW) == 0)
+            set_raw_valuators(raw, &mask, raw->valuators.data);
+
         moveRelative(pDev, &mask);
     }
 
     /* valuators are in device coordinate system in absolute coordinates */
-
-    if ((flags & POINTER_NORAW) == 0)
-        set_raw_valuators(raw, &mask, raw->valuators.data);
-
     scale_to_desktop(pDev, &mask, &devx, &devy, &screenx, &screeny);
     scr = positionSprite(pDev, (flags & POINTER_ABSOLUTE) ? Absolute : Relative,
                          &mask, &devx, &devy, &screenx, &screeny);

commit a095f7ae96a353073add83e78f88f29d854d289d
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Wed Mar 21 14:03:27 2012 +1000

    dix: fix compiler warning "unused variable 'scr'"
    
    getevents.c: In function 'updateSlaveDeviceCoords':
    getevents.c:326:15: warning: unused variable 'scr' [-Wunused-variable]
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit 9c3bd3ae652af386b6821b197d24528f20ba867d)

diff --git a/dix/getevents.c b/dix/getevents.c
index 68bf58c..260955b 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -328,7 +328,6 @@ rescaleValuatorAxis(double coord, AxisInfoPtr from, AxisInfoPtr to,
 static void
 updateSlaveDeviceCoords(DeviceIntPtr master, DeviceIntPtr pDev)
 {
-    ScreenPtr scr = miPointerGetScreen(pDev);
     int i;
     DeviceIntPtr lastSlave;
 

commit d0a6d9bcefaf56aa63708ea69e5c399dbf266d63
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Mon Mar 12 16:26:29 2012 +1000

    Xext: drop InitServertime() declaration.
    
    Not implemented anywhere.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
    Reviewed-by: Bryce Harrington <bryce@canonical.com>
    (cherry picked from commit 5910f2df58beaae2187438fef0b62c29a563e853)

diff --git a/Xext/syncsrv.h b/Xext/syncsrv.h
index e7ef1f4..b0464b3 100644
--- a/Xext/syncsrv.h
+++ b/Xext/syncsrv.h
@@ -141,7 +141,5 @@ extern void SyncChangeCounter(SyncCounter * /* pCounter */ ,
 
 extern void SyncDestroySystemCounter(pointer pCounter);
 
-extern void InitServertime(void);
-
 extern void SyncExtensionInit(void);
 #endif                          /* _SYNCSRV_H_ */

commit f8446ad3d71cdf9c2200f5584bd156c629fe3c90
Author: Chase Douglas <chase.douglas@canonical.com>
Date:   Wed Mar 7 16:06:27 2012 -0800

    Use a new sprite trace for indirect touches when all touches have physically ended
    
    All touches of an indirect device, such as a trackpad, are sent to the
    same window set. When there are no active touches, a new window set is
    created; otherwise, the window set of an existing touch is copied.
    
    The current code checks for any logically active touches. This includes
    touches that have physically ended but are still logically active due to
    unhandled touch grabs. Instead, we want a new window set whenever there
    are no physically active touches.
    
    This change skips over logically active but pending end touches, which
    are touches that have physically ended.
    
    Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit 31df08a449cf9b6e1740e1c02257997490630d93)

diff --git a/dix/touch.c b/dix/touch.c
index 5d7132e..0829b65 100644
--- a/dix/touch.c
+++ b/dix/touch.c
@@ -510,7 +510,8 @@ TouchBuildDependentSpriteTrace(DeviceIntPtr dev, SpritePtr sprite)
     /* All touches should have the same sprite trace, so find and reuse an
      * existing touch's sprite if possible, else use the device's sprite. */
     for (i = 0; i < t->num_touches; i++)
-        if (t->touches[i].sprite.spriteTraceGood > 0)
+        if (!t->touches[i].pending_finish &&
+            t->touches[i].sprite.spriteTraceGood > 0)
             break;
     if (i < t->num_touches)
         srcsprite = &t->touches[i].sprite;

commit 5a3ec826e653377e8b70e7553d1f0ca72210447c
Author: Chase Douglas <chase.douglas@canonical.com>
Date:   Wed Mar 7 16:06:26 2012 -0800

    Xi: Fix TouchEnd to TouchUpdate change for one accepted grab
    
    If there is only one listener of a touch, the listener is a grab, and is
    accepted before the touch has ended, the current code will not end the
    touch record when the touch does end.
    
    This change adds a listener state for when a touch is accepted but has
    not yet ended. We now keep the touch record alive in this state, but end
    it when the touch ends.
    
    Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit 58427e08a4a36ce9e213e4b4fe5249d5db2c764d)

diff --git a/Xi/exevents.c b/Xi/exevents.c
index a690a19..f681a8b 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -1210,6 +1210,8 @@ ProcessTouchOwnershipEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
         /* Owner accepted after receiving end */
         if (ti->listeners[0].state == LISTENER_HAS_END)
             TouchEndTouch(dev, ti);
+        else
+            ti->listeners[0].state = LISTENER_HAS_ACCEPTED;
     }
     else {                      /* this is the very first ownership event for a grab */
         DeliverTouchEvents(dev, ti, (InternalEvent *) ev, ev->resource);
@@ -1730,7 +1732,11 @@ DeliverTouchBeginEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
     else {
         if (has_ownershipmask)
             TouchSendOwnershipEvent(dev, ti, 0, listener->listener);
-        state = LISTENER_IS_OWNER;
+
+        if (!has_ownershipmask || listener->type == LISTENER_REGULAR)
+            state = LISTENER_HAS_ACCEPTED;
+        else
+            state = LISTENER_IS_OWNER;
     }
     listener->state = state;
 
@@ -1759,20 +1765,22 @@ DeliverTouchEndEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev,
         listener->state = LISTENER_HAS_END;
     }
     else if (TouchResourceIsOwner(ti, listener->listener)) {
+        Bool normal_end = !(ev->device_event.flags & TOUCH_ACCEPT);
+
         /* FIXME: what about early acceptance */
-        if (!(ev->device_event.flags & TOUCH_ACCEPT)) {
-            if (listener->state != LISTENER_HAS_END)
-                rc = DeliverOneTouchEvent(client, dev, ti, grab, win, ev);
-            listener->state = LISTENER_HAS_END;
-        }
+        if (normal_end && listener->state != LISTENER_HAS_END)
+            rc = DeliverOneTouchEvent(client, dev, ti, grab, win, ev);
+
         if ((ti->num_listeners > 1 ||
-             (listener->type == LISTENER_GRAB &&
-              xi2mask_isset(xi2mask, dev, XI_TouchOwnership))) &&
+             listener->state != LISTENER_HAS_ACCEPTED) &&
             (ev->device_event.flags & (TOUCH_ACCEPT | TOUCH_REJECT)) == 0) {
             ev->any.type = ET_TouchUpdate;
             ev->device_event.flags |= TOUCH_PENDING_END;
             ti->pending_finish = TRUE;
         }
+
+        if (normal_end)
+            listener->state = LISTENER_HAS_END;
     }
 
  out:
diff --git a/include/input.h b/include/input.h
index a9d0944..d891fe5 100644
--- a/include/input.h
+++ b/include/input.h
@@ -523,7 +523,8 @@ enum TouchListenerState {
     LISTENER_AWAITING_OWNER,       /**< Waiting for a TouchOwnership event */
     LISTENER_EARLY_ACCEPT,         /**< Waiting for ownership, has already
                                         accepted */
-    LISTENER_IS_OWNER,             /**< Is the current owner */
+    LISTENER_IS_OWNER,             /**< Is the current owner, hasn't accepted */
+    LISTENER_HAS_ACCEPTED,         /**< Is the current owner, has accepted */
     LISTENER_HAS_END,              /**< Has already received the end event */
 };
 

commit a8c9a93c66edce893af3ba460d728fe2bc48c2af
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Mon Feb 27 10:09:44 2012 +1000

    dix: when rescaling from master, rescale from desktop dimensions (#46657)
    
    master->last.valuators[] is in desktop dimensions, so use those as
    rescale axis ranges, not the screen. Otherwise, a rescale on any screen
    not the top-left will cause out-of-bounds coordinates which will always
    map to the bottom-right screen, causing the device to be stuck on that
    screen.
    
    X.Org Bug 46657 <http://bugs.freedesktop.org/show_bug.cgi?id=46657>
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
    (cherry picked from commit eb84c154ed38194c32651727b6dfe2d1bde4c599)

diff --git a/dix/getevents.c b/dix/getevents.c
index 2f6f06c..68bf58c 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -345,13 +345,15 @@ updateSlaveDeviceCoords(DeviceIntPtr master, DeviceIntPtr pDev)
         pDev->last.valuators[0] = rescaleValuatorAxis(pDev->last.valuators[0],
                                                       NULL,
                                                       pDev->valuator->axes + 0,
-                                                      0, scr->width);
+                                                      screenInfo.x,
+                                                      screenInfo.width);
     }
     if (pDev->valuator->numAxes > 1) {
         pDev->last.valuators[1] = rescaleValuatorAxis(pDev->last.valuators[1],
                                                       NULL,
                                                       pDev->valuator->axes + 1,
-                                                      0, scr->height);
+                                                      screenInfo.y,
+                                                      screenInfo.height);
     }
 
     /* calculate the other axis as well based on info from the old

commit bc8dc7183b50800470080eaa9c04cfd6ecc3591b
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Thu Feb 16 15:11:40 2012 +1000

    Xext: return BadAccess if PickPointer fails (#45796)
    
    PickPointer or PickKeyboard return NULL, all MDs are currently disabled and
    we cannot emulate a core event. This wasn't anticipated by the protocol, so
    we don't really have an error code we may use here - BadAccess is simply the
    least bad of the possible ones.
    
    And returning BadAccess beats crashing the server.
    
    X.Org Bug 45796 <http://bugs.freedesktop.org/show_bug.cgi?id=45796>
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit 6b6afd3d013e3f4910fae3520d1d786df2b0e47a)

diff --git a/Xext/xtest.c b/Xext/xtest.c
index 2414457..e659b41 100644
--- a/Xext/xtest.c
+++ b/Xext/xtest.c
@@ -118,6 +118,10 @@ ProcXTestCompareCursor(ClientPtr client)
     rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
     if (rc != Success)
         return rc;
+
+    if (!ptr)
+        return BadAccess;
+
     if (stuff->cursor == None)
         pCursor = NullCursor;
     else if (stuff->cursor == XTestCurrentCursor)
@@ -307,9 +311,15 @@ ProcXTestFakeInput(ClientPtr client)
             return BadValue;
         }
 
+        /* Technically the protocol doesn't allow for BadAccess here but
+         * this can only happen when all MDs are disabled.  */
+        if (!dev)
+            return BadAccess;
+
         dev = GetXTestDevice(dev);
     }
 
+
     /* If the event has a time set, wait for it to pass */
     if (ev->u.keyButtonPointer.time) {
         TimeStamp activateTime;

commit 1e2a7462bec388342424f22ebf77a6fd3f177d7d
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date:   Sun Mar 25 23:33:54 2012 -0700

    XQuartz: Use scrolling valuators
    
    This lets use send more accurate data to Xi clients and uses dix
    for legacy scroll buttons rather than reinventing the wheel.
    
    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
    Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit 31646d8fa9524adca1d7bc2cd2db90d47c2eb96e)

diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index 40e8a82..7fd3d16 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -1608,8 +1608,7 @@ handle_mouse:
             deltaY *= -1;
         }
 #endif
-        DarwinSendScrollEvents(deltaX, deltaY, location.x, location.y,
-                               pressure, tilt.x, tilt.y);
+        DarwinSendScrollEvents(deltaX, deltaY);
         break;
     }
 
diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c
index a1c93d9..ff6581c 100644
--- a/hw/xquartz/darwin.c
+++ b/hw/xquartz/darwin.c
@@ -306,10 +306,10 @@ DarwinScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
 static int
 DarwinMouseProc(DeviceIntPtr pPointer, int what)
 {
-#define NBUTTONS 7
-#define NAXES    2
-    // 7 buttons: left, right, middle, then four scroll wheel "buttons"
-    CARD8 map[NBUTTONS + 1] = { 0, 1, 2, 3, 4, 5, 6, 7 };
+#define NBUTTONS 3
+#define NAXES    4
+    // 3 buttons: left, middle, right
+    CARD8 map[NBUTTONS + 1] = { 0, 1, 2, 3};
     Atom btn_labels[NBUTTONS] = { 0 };
     Atom axes_labels[NAXES] = { 0 };
 
@@ -320,13 +320,11 @@ DarwinMouseProc(DeviceIntPtr pPointer, int what)
         btn_labels[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT);
         btn_labels[1] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_MIDDLE);
         btn_labels[2] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_RIGHT);
-        btn_labels[3] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_UP);
-        btn_labels[4] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_DOWN);
-        btn_labels[5] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_HWHEEL_LEFT);
-        btn_labels[6] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_HWHEEL_RIGHT);
 
         axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_X);
         axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y);
+        axes_labels[2] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_WHEEL);
+        axes_labels[3] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_HWHEEL);
 
         // Set button map.
         InitPointerDeviceStruct((DevicePtr)pPointer, map, NBUTTONS,
@@ -334,12 +332,21 @@ DarwinMouseProc(DeviceIntPtr pPointer, int what)
                                 (PtrCtrlProcPtr)NoopDDA,
                                 GetMotionHistorySize(), NAXES,
                                 axes_labels);
-        InitValuatorAxisStruct(pPointer, 0, axes_labels[0], NO_AXIS_LIMITS,
-                               NO_AXIS_LIMITS, 1, 0, 1,
-                               Relative);
-        InitValuatorAxisStruct(pPointer, 1, axes_labels[1], NO_AXIS_LIMITS,
-                               NO_AXIS_LIMITS, 1, 0, 1,
-                               Relative);
+        InitValuatorAxisStruct(pPointer, 0, axes_labels[0], 
+                               NO_AXIS_LIMITS, NO_AXIS_LIMITS,
+                               1, 0, 1, Relative);
+        InitValuatorAxisStruct(pPointer, 1, axes_labels[1], 
+                               NO_AXIS_LIMITS, NO_AXIS_LIMITS,
+                               1, 0, 1, Relative);
+        InitValuatorAxisStruct(pPointer, 2, axes_labels[2], 
+                               NO_AXIS_LIMITS, NO_AXIS_LIMITS,
+                               1, 0, 1, Relative);
+        InitValuatorAxisStruct(pPointer, 3, axes_labels[3], 
+                               NO_AXIS_LIMITS, NO_AXIS_LIMITS,
+                               1, 0, 1, Relative);
+
+        SetScrollValuator(pPointer, 2, SCROLL_TYPE_VERTICAL, -1.0, SCROLL_FLAG_PREFERRED);
+        SetScrollValuator(pPointer, 3, SCROLL_TYPE_HORIZONTAL, -1.0, SCROLL_FLAG_NONE);
         break;
 
     case DEVICE_ON:
diff --git a/hw/xquartz/darwinEvents.c b/hw/xquartz/darwinEvents.c
index 44f0639..c62dd44 100644
--- a/hw/xquartz/darwinEvents.c
+++ b/hw/xquartz/darwinEvents.c
@@ -653,42 +653,33 @@ DarwinSendProximityEvents(DeviceIntPtr pDev, int ev_type, double pointer_x,
 
 /* Send the appropriate number of button clicks to emulate scroll wheel */
 void
-DarwinSendScrollEvents(double scroll_x, double scroll_y,
-                       double pointer_x, double pointer_y,
-                       double pressure, double tilt_x, double tilt_y)
-{
-    int sign_x, sign_y;
+DarwinSendScrollEvents(double scroll_x, double scroll_y) {
+    ScreenPtr screen;
+    ValuatorMask valuators;
+
     if (!darwinEvents) {
         DEBUG_LOG(
             "DarwinSendScrollEvents called before darwinEvents was initialized\n");
         return;
     }
 
-    sign_x = scroll_x > 0.0f ? SCROLLWHEELLEFTFAKE : SCROLLWHEELRIGHTFAKE;
-    sign_y = scroll_y > 0.0f ? SCROLLWHEELUPFAKE : SCROLLWHEELDOWNFAKE;
-    scroll_x = fabs(scroll_x);
-    scroll_y = fabs(scroll_y);
-
-    while ((scroll_x > 0.0f) || (scroll_y > 0.0f)) {
-        if (scroll_x > 0.0f) {
-            DarwinSendPointerEvents(darwinPointer, ButtonPress, sign_x,
-                                    pointer_x, pointer_y, pressure, tilt_x,
-                                    tilt_y);
-            DarwinSendPointerEvents(darwinPointer, ButtonRelease, sign_x,
-                                    pointer_x, pointer_y, pressure, tilt_x,
-                                    tilt_y);
-            scroll_x = scroll_x - 1.0f;
-        }
-        if (scroll_y > 0.0f) {
-            DarwinSendPointerEvents(darwinPointer, ButtonPress, sign_y,
-                                    pointer_x, pointer_y, pressure, tilt_x,
-                                    tilt_y);
-            DarwinSendPointerEvents(darwinPointer, ButtonRelease, sign_y,
-                                    pointer_x, pointer_y, pressure, tilt_x,
-                                    tilt_y);
-            scroll_y = scroll_y - 1.0f;
-        }
+    screen = miPointerGetScreen(darwinPointer);
+    if (!screen) {
+        DEBUG_LOG(
+            "DarwinSendScrollEvents called before screen was initialized\n");
+        return;
     }
+
+    valuator_mask_zero(&valuators);
+    valuator_mask_set_double(&valuators, 2, scroll_y);
+    valuator_mask_set_double(&valuators, 3, scroll_x);
+
+    darwinEvents_lock();
+    {
+        QueuePointerEvents(darwinPointer, MotionNotify, 0,
+                           POINTER_RELATIVE, &valuators);
+        DarwinPokeEQ();
+    } darwinEvents_unlock();    
 }
 
 /* Send the appropriate KeyPress/KeyRelease events to GetKeyboardEvents to
diff --git a/hw/xquartz/darwinEvents.h b/hw/xquartz/darwinEvents.h
index 3868dc6..61ace6e 100644
--- a/hw/xquartz/darwinEvents.h
+++ b/hw/xquartz/darwinEvents.h
@@ -55,9 +55,7 @@ DarwinSendProximityEvents(DeviceIntPtr pDev, int ev_type, double pointer_x,
 void
 DarwinSendKeyboardEvents(int ev_type, int keycode);
 void
-DarwinSendScrollEvents(double scroll_x, double scroll_y, double pointer_x,
-                       double pointer_y, double pressure, double tilt_x,
-                       double tilt_y);
+DarwinSendScrollEvents(double scroll_x, double scroll_y);
 void
 DarwinUpdateModKeys(int flags);
 void

commit 67d20e393fdbcc0702a9b3e9848faaa3571d8534
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date:   Sun Mar 25 22:30:55 2012 -0700

    XQuartz: Use AllocDevicePair to allocate our keyboard and mouse at the same time
    
    Also correct isMaster to FALSE while we're here.
    
    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
    Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit 7790dc86384cc451ac44663737fde84dd81ad4e1)

diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c
index f6c2238..a1c93d9 100644
--- a/hw/xquartz/darwin.c
+++ b/hw/xquartz/darwin.c
@@ -510,11 +510,13 @@ InitInput(int argc, char **argv)
         .rules   = "base", .model         = "empty", .layout = "empty",
         .variant = NULL,   .options       = NULL
     };
+
     /* We need to really have rules... or something... */
     XkbSetRulesDflts(&rmlvo);
 
-    darwinKeyboard = AddInputDevice(serverClient, DarwinKeybdProc, TRUE);
-    darwinKeyboard->name = strdup("keyboard");
+    assert(Success == AllocDevicePair(serverClient, "xquartz virtual",
+                                      &darwinPointer, &darwinKeyboard,
+                                      DarwinMouseProc, DarwinKeybdProc, FALSE));
 
     /* here's the snippet from the current gdk sources:
        if (!strcmp (tmp_name, "pointer"))
@@ -530,16 +532,16 @@ InitInput(int argc, char **argv)
        gdkdev->info.source = GDK_SOURCE_PEN;
      */
 
-    darwinPointer = AddInputDevice(serverClient, DarwinMouseProc, TRUE);
-    darwinPointer->name = strdup("pointer");
-
-    darwinTabletStylus = AddInputDevice(serverClient, DarwinTabletProc, TRUE);
+    darwinTabletStylus = AddInputDevice(serverClient, DarwinTabletProc, FALSE);
+    assert(darwinTabletStylus);
     darwinTabletStylus->name = strdup("pen");
 
-    darwinTabletCursor = AddInputDevice(serverClient, DarwinTabletProc, TRUE);
+    darwinTabletCursor = AddInputDevice(serverClient, DarwinTabletProc, FALSE);
+    assert(darwinTabletCursor);
     darwinTabletCursor->name = strdup("cursor");
 
-    darwinTabletEraser = AddInputDevice(serverClient, DarwinTabletProc, TRUE);
+    darwinTabletEraser = AddInputDevice(serverClient, DarwinTabletProc, FALSE);
+    assert(darwinTabletEraser);
     darwinTabletEraser->name = strdup("eraser");
 
     DarwinEQInit();

commit 3ee84899b1a3ea5d12e384046c52c7262af78395
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date:   Sun Mar 25 22:16:22 2012 -0700

    XQuartz: Call update_desktop_dimensions() after updating our screen coordinates
    
    Fixes: http://xquartz.macosforge.org/trac/ticket/555
    Regression from: 8bebb4b4896d8b6ba3309b5b28fce883bb9f8a96
    
    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
    Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit 74fb534bf15687610367248071341fe4bfd1d8bf)

diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c
index 7375ec1..f6c2238 100644
--- a/hw/xquartz/darwin.c
+++ b/hw/xquartz/darwin.c
@@ -604,6 +604,9 @@ DarwinAdjustScreenOrigins(ScreenInfo *pScreenInfo)
                       pScreenInfo->screens[i]->y);
         }
     }
+
+    /* Update screenInfo.x/y */
+    update_desktop_dimensions();
 }
 
 /*

commit 815414858b918c39fdfb5f7500e2eec5d4946fba
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date:   Sun Mar 25 23:05:43 2012 -0700

    XQuartz: Formatting cleanup for sendX11NSEvent
    
    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
    (cherry picked from commit 41a46546e92b66fed323b5845dd71a6385feb418)

diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index b2bc2ba..40e8a82 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -1307,22 +1307,23 @@ untrusted_str(NSEvent *e)
     }
 #endif
 
-    isMouseOrTabletEvent = [e type] == NSLeftMouseDown || [e type] ==
-                           NSOtherMouseDown || [e type] ==
-                           NSRightMouseDown ||
-                           [e type] == NSLeftMouseUp || [e type] ==
-                           NSOtherMouseUp || [e type] == NSRightMouseUp ||
-                           [e type] == NSLeftMouseDragged || [e type] ==
-                           NSOtherMouseDragged || [e type] ==
-                           NSRightMouseDragged ||
-                           [e type] == NSMouseMoved || [e type] ==
-                           NSTabletPoint || [e type] == NSScrollWheel;
+    isMouseOrTabletEvent = [e type] == NSLeftMouseDown ||
+                           [e type] == NSOtherMouseDown ||
+                           [e type] == NSRightMouseDown ||
+                           [e type] == NSLeftMouseUp ||
+                           [e type] == NSOtherMouseUp ||
+                           [e type] == NSRightMouseUp ||
+                           [e type] == NSLeftMouseDragged ||
+                           [e type] == NSOtherMouseDragged ||
+                           [e type] == NSRightMouseDragged ||
+                           [e type] == NSMouseMoved ||
+                           [e type] == NSTabletPoint || 
+                           [e type] == NSScrollWheel;
 
     isTabletEvent = ([e type] == NSTabletPoint) ||
                     (isMouseOrTabletEvent &&
                      ([e subtype] == NSTabletPointEventSubtype ||
-                      [e subtype] ==
-                      NSTabletProximityEventSubtype));
+                      [e subtype] == NSTabletProximityEventSubtype));
 
     if (isMouseOrTabletEvent) {
         static NSPoint lastpt;
@@ -1340,19 +1341,16 @@ untrusted_str(NSEvent *e)
         // The deltaXY for middle click events also appear erroneous after fast user switching
         // <rdar://problem/7979468> deltaX and deltaY are incorrect for NSOtherMouseDown and NSOtherMouseUp after FUS
         // http://xquartz.macosforge.org/trac/ticket/389
-        hasUntrustedPointerDelta = hasUntrustedPointerDelta || [e type] ==
-                                   NSOtherMouseDown || [e type] ==
-                                   NSOtherMouseUp;
+        hasUntrustedPointerDelta |= [e type] == NSOtherMouseDown ||
+                                    [e type] == NSOtherMouseUp;
 
         // The deltaXY for scroll events correspond to the scroll delta, not the pointer delta
         // <rdar://problem/7989690> deltaXY for wheel events are being sent as mouse movement
-        hasUntrustedPointerDelta = hasUntrustedPointerDelta || [e type] ==
-                                   NSScrollWheel;
+        hasUntrustedPointerDelta |= [e type] == NSScrollWheel;
 
 #ifdef DEBUG_UNTRUSTED_POINTER_DELTA
-        hasUntrustedPointerDelta = hasUntrustedPointerDelta || [e type] ==
-                                   NSLeftMouseDown || [e type] ==
-                                   NSLeftMouseUp;
+        hasUntrustedPointerDelta |= [e type] == NSLeftMouseDown ||
+                                    [e type] == NSLeftMouseUp;
 #endif
 
         if (window != nil) {
@@ -1398,21 +1396,18 @@ untrusted_str(NSEvent *e)
     /* This is to workaround a bug in the VNC server where we sometimes see the L
      * modifier and sometimes see no "side"
      */
-    modifierFlags =
-        ensure_flag(modifierFlags, NX_CONTROLMASK, NX_DEVICELCTLKEYMASK |
-                    NX_DEVICERCTLKEYMASK,
-                    NX_DEVICELCTLKEYMASK);
-    modifierFlags = ensure_flag(
-        modifierFlags, NX_SHIFTMASK, NX_DEVICELSHIFTKEYMASK |
-        NX_DEVICERSHIFTKEYMASK, NX_DEVICELSHIFTKEYMASK);
-    modifierFlags =
-        ensure_flag(modifierFlags, NX_COMMANDMASK, NX_DEVICELCMDKEYMASK |
-                    NX_DEVICERCMDKEYMASK,
-                    NX_DEVICELCMDKEYMASK);
-    modifierFlags =
-        ensure_flag(modifierFlags, NX_ALTERNATEMASK, NX_DEVICELALTKEYMASK |
-                    NX_DEVICERALTKEYMASK,
-                    NX_DEVICELALTKEYMASK);
+    modifierFlags = ensure_flag(modifierFlags, NX_CONTROLMASK,
+                                NX_DEVICELCTLKEYMASK | NX_DEVICERCTLKEYMASK,
+                                NX_DEVICELCTLKEYMASK);
+    modifierFlags = ensure_flag(modifierFlags, NX_SHIFTMASK,
+                                NX_DEVICELSHIFTKEYMASK | NX_DEVICERSHIFTKEYMASK, 
+                                NX_DEVICELSHIFTKEYMASK);
+    modifierFlags = ensure_flag(modifierFlags, NX_COMMANDMASK,
+                                NX_DEVICELCMDKEYMASK | NX_DEVICERCMDKEYMASK,
+                                NX_DEVICELCMDKEYMASK);
+    modifierFlags = ensure_flag(modifierFlags, NX_ALTERNATEMASK,


Reply to: