xserver: Branch 'master' - 5 commits

Keith Packard keithp at kemper.freedesktop.org
Wed Mar 10 15:07:04 PST 2010


 dix/events.c                   |   63 ++++++++++++++++++++++++++++++++++++++++-
 dix/getevents.c                |    5 +--
 hw/xfree86/common/xf86Config.c |   26 +++++-----------
 os/utils.c                     |    3 -
 4 files changed, 74 insertions(+), 23 deletions(-)

New commits:
commit f2eacb4646beb25d055de22868f93e6b24f229b6
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Wed Mar 10 09:39:05 2010 +1000

    Revert "dix: Use DeliverGrabbedEvent for implicit passive grabs (#25400)"
    
    Several users have pointed out that this commit introduces regressions, most
    notably perhaps fluxbox which essentially stops working after a few clicks.
    
    This reverts commit cf72b5437d2d620521279077a29c5df6d0fbb576.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/dix/events.c b/dix/events.c
index 1611f7d..8af8c5a 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -3462,6 +3462,7 @@ CheckPassiveGrabsOnWindow(
     {
 	DeviceIntPtr	gdev;
 	XkbSrvInfoPtr	xkbi = NULL;
+	Mask		mask = 0;
 
 	gdev= grab->modifierDevice;
         if (grab->grabtype == GRABTYPE_CORE)
@@ -3514,6 +3515,10 @@ CheckPassiveGrabsOnWindow(
 	     (grab->confineTo->realized &&
 				BorderSizeNotEmpty(device, grab->confineTo))))
 	{
+            int rc, count = 0;
+            xEvent *xE = NULL;
+            xEvent core;
+
             event->corestate &= 0x1f00;
             event->corestate |= tempGrab.modifiersDetail.exact & (~0x1f00);
             grabinfo = &device->deviceGrab;
@@ -3560,8 +3565,62 @@ CheckPassiveGrabsOnWindow(
             }
 
 
+            if (match & CORE_MATCH)
+            {
+                rc = EventToCore((InternalEvent*)event, &core);
+                if (rc != Success)
+                {
+                    if (rc != BadMatch)
+                        ErrorF("[dix] %s: core conversion failed in CPGFW "
+                                "(%d, %d).\n", device->name, event->type, rc);
+                    continue;
+                }
+                xE = &core;
+                count = 1;
+                mask = grab->eventMask;
+            } else if (match & XI2_MATCH)
+            {
+                rc = EventToXI2((InternalEvent*)event, &xE);
+                if (rc != Success)
+                {
+                    if (rc != BadMatch)
+                        ErrorF("[dix] %s: XI2 conversion failed in CPGFW "
+                                "(%d, %d).\n", device->name, event->type, rc);
+                    continue;
+                }
+                count = 1;
+
+                /* FIXME: EventToXI2 returns NULL for enter events, so
+                 * dereferencing the event is bad. Internal event types are
+                 * aligned with core events, so the else clause is valid.
+                 * long-term we should use internal events for enter/focus
+                 * as well */
+                if (xE)
+                    mask = grab->xi2mask[device->id][((xGenericEvent*)xE)->evtype/8];
+                else if (event->type == XI_Enter || event->type == XI_FocusIn)
+                    mask = grab->xi2mask[device->id][event->type/8];
+            } else
+            {
+                rc = EventToXI((InternalEvent*)event, &xE, &count);
+                if (rc != Success)
+                {
+                    if (rc != BadMatch)
+                        ErrorF("[dix] %s: XI conversion failed in CPGFW "
+                                "(%d, %d).\n", device->name, event->type, rc);
+                    continue;
+                }
+                mask = grab->eventMask;
+            }
+
 	    (*grabinfo->ActivateGrab)(device, grab, currentTime, TRUE);
-            DeliverGrabbedEvent((InternalEvent*)event, device, FALSE);
+
+            if (xE)
+            {
+                FixUpEventFromWindow(device, xE, grab->window, None, TRUE);
+
+                TryClientEvents(rClient(grab), device, xE, count, mask,
+                                       GetEventFilter(device, xE), grab);
+            }
 
 	    if (grabinfo->sync.state == FROZEN_NO_EVENT)
 	    {
@@ -3571,6 +3630,8 @@ CheckPassiveGrabsOnWindow(
 		grabinfo->sync.state = FROZEN_WITH_EVENT;
             }
 
+            if (match & (XI_MATCH | XI2_MATCH))
+                xfree(xE); /* on core match xE == &core */
 	    return TRUE;
 	}
     }
commit df9f3273041c6c3e0da2d2254e8c156cd582e296
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Wed Mar 10 09:24:32 2010 +1000

    xfree86: fix xf86Config.c build error in --enable-debug mode. (#26971)
    
    xf86Config.c: In function 'configInputDevices':
    xf86Config.c:1514: error: request for member 'lay_identifier' in something
    not a structure or union
    make[5]: *** [xf86Config.lo] Error 1
    
    Introduced with e1165632bdfbd720889ed1adf5f7ab338032c0ee.
    
    X.Org Bug 26971 <http://bugs.freedesktop.org/show_bug.cgi?id=26971>
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Acked-by: Dan Nicholson <dbn.lists at gmail.com>

diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 65725d2..718a078 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -1503,7 +1503,7 @@ configInputDevices(XF86ConfLayoutPtr layout, serverLayoutPtr servlayoutp)
 	irp = (XF86ConfInputrefPtr)irp->list.next;
     }
     DebugF("Found %d input devices in the layout section %s\n",
-	    count, layout.lay_identifier);
+	    count, layout->lay_identifier);
     indp = xnfcalloc((count + 1), sizeof(IDevPtr));
     indp[count] = NULL;
     irp = layout->lay_input_lst;
commit 116068103282924ef1476231d13d54719a797252
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Tue Mar 9 09:35:23 2010 +1000

    xfree86: don't warn about nonexisting core pointer/keyboard in config.
    
    In the vast majority of cases there is no xorg.conf that specifies a core
    pointer/keyboard. Skip this warning, since we'll get another notification
    about how the server relies on the config backend for input devices anyway.
    
    Leave the warning in for the error case (AEI off).
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Fernando Carrijo <fcarrijo at yahoo.com.br>
    Reviewed-by: Dan Nicholson <dbn.lists at gmail.com>

diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 132e8bc..65725d2 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -1286,14 +1286,10 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
 	}
     }
 
-    if (!foundPointer) {
-	if (!xf86Info.allowEmptyInput) {
-	    /* This shouldn't happen. */
-	    xf86Msg(X_ERROR, "Cannot locate a core pointer device.\n");
-	    return FALSE;
-	} else {
-	    xf86Msg(X_INFO, "Cannot locate a core pointer device.\n");
-	}
+    if (!foundPointer && !xf86Info.allowEmptyInput) {
+	/* This shouldn't happen. */
+	xf86Msg(X_ERROR, "Cannot locate a core pointer device.\n");
+	return FALSE;
     }
 
     /*
@@ -1430,14 +1426,10 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
 	}
     }
 
-    if (!foundKeyboard) {
-	if (!xf86Info.allowEmptyInput) {
-		/* This shouldn't happen. */
-		xf86Msg(X_ERROR, "Cannot locate a core keyboard device.\n");
-		return FALSE;
-	} else {
-		xf86Msg(X_INFO, "Cannot locate a core keyboard device.\n");
-	}
+    if (!foundKeyboard && !xf86Info.allowEmptyInput) {
+	/* This shouldn't happen. */
+	xf86Msg(X_ERROR, "Cannot locate a core keyboard device.\n");
+	return FALSE;
     }
 
     if (pointerMsg) {
commit c39c8ece9bd3ce025549f4bac7794f5a62266f4a
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Wed Feb 10 15:06:52 2010 +1000

    os: remove INTERNAL_MALLOC define.
    
    There doesn't seem to be anything that defines it and given that the
    counterpart (the X internal malloc) was removed in
    01cfba75229f4b9bf1e4fe80814931acdacde14c it's unlikely to work anyway.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/os/utils.c b/os/utils.c
index 21e25e0..5a5a203 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -1032,8 +1032,6 @@ set_font_authorizations(char **authorizations, int *authlen, pointer client)
 #endif /* TCPCONN */
 }
 
-#ifndef INTERNAL_MALLOC
-
 void *
 Xalloc(unsigned long amount)
 {
@@ -1149,7 +1147,6 @@ Xfree(pointer ptr)
     if (ptr)
 	free(ptr); 
 }
-#endif /* !INTERNAL_MALLOC */
 
 
 char *
commit 9f462ff9082634719e64d2d8d4dbd09ec7deaf2e
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Feb 26 14:02:09 2010 +1000

    dix: Clip only into axis ranges if we're in absolute mode. (#26543)
    
    An absolute device in relative mode may provide valuators outside of the
    axis range. Clipping back into the range prevents screen crossings in a
    multi-screen (Xinerama) setup as the required screen edge for crossing is
    never met: miPointerSetPosition crosses the screen conditional to the X
    coordinate being equal to the screen width or _less than_ 0. While the
    former can be met when clipping into the coordinate range and scaling, the
    latter cannot, resulting in a mouse pointer that gets stuck on the rightmost
    screen.
    
    This patch only applies axis clipping for valuators in mode Absolute. If
    relative, we allow the values to get above/below the axis ranges. Doesn't
    matter, miPointerSetPosition will reset the values to the allowed range even
    if no screen was crossed.
    This leads to interesting values provided to clients, the valuator range of
    the device resets once a screen is crossed and essentially reflects
    the position of the cursor on the screen - scaled into the valuator range.
    The values themselves are valid given the range though.
    
    In theory, the XI1 specs require that a relative device has a min/max range
    of 0/0. This doesn't really go well with devices that actually can switch
    mode between relative and absolute since they would have to reset their axis
    range when switching. If multiple XI clients are in use, we have no method
    of notifying them about the changes, so other clients may continue to use
    the wrong axis ranges (note: XI1 wasn't really designed to have multiple
    clients use a device). Expecting all relative devices to have this min/max
    of 0 is unrealistic at this point.
    
    So pick what is possibly the lesser of all evils, pass the beer and despair.
    
    X.Org Bug 26543 <http://bugs.freedesktop.org/show_bug.cgi?id=26543>
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>

diff --git a/dix/getevents.c b/dix/getevents.c
index 82bb77b..197deb4 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -710,7 +710,7 @@ moveRelative(DeviceIntPtr dev, int *x, int *y,
     /* if attached, clip both x and y to the defined limits (usually
      * co-ord space limit). If it is attached, we need x/y to go over the
      * limits to be able to change screens. */
-    if(dev->u.master) {
+    if(dev->u.master && dev->valuator->mode == Absolute) {
         clipAxis(dev, 0, x);
         clipAxis(dev, 1, y);
     }
@@ -720,7 +720,8 @@ moveRelative(DeviceIntPtr dev, int *x, int *y,
     for (; i < num; i++)
     {
         dev->last.valuators[i + first] += valuators[i];
-        clipAxis(dev, i, &dev->last.valuators[i + first]);
+        if (dev->valuator->mode == Absolute)
+            clipAxis(dev, i, &dev->last.valuators[i + first]);
         valuators[i] = dev->last.valuators[i + first];
     }
 }


More information about the xorg-commit mailing list