xserver: Branch 'server-1.13-branch' - 10 commits

Matt Dew marcoz at kemper.freedesktop.org
Mon Feb 18 13:49:05 PST 2013


 dix/devices.c              |    6 ++++++
 dix/events.c               |    6 ++++++
 dix/getevents.c            |   30 ++++++++++++++++++++++++++----
 hw/dmx/config/xdmxconfig.c |    3 ---
 randr/rrcrtc.c             |    5 +++++
 xfixes/xfixes.c            |    2 +-
 xkb/xkbAccessX.c           |   30 +++++++++++++++++-------------
 7 files changed, 61 insertions(+), 21 deletions(-)

New commits:
commit 412c4abbaec2c26b421f407427c1a9d5b7c2de23
Merge: e604b19 e7b4b83
Author: Matt Dew <marcoz at osource.org>
Date:   Mon Feb 18 13:23:07 2013 -0700

    Merge branch 'server-1.13-branch' of git://people.freedesktop.org/~whot/xserver into server-1.13-branch

commit e604b19fc54fee839bbe2d66930b36108ff03950
Author: Aaron Plattner <aplattner at nvidia.com>
Date:   Wed Jan 23 16:58:47 2013 -0800

    randr: unref the provider shared pixmap the appropriate number of times
    
    When an RandR shared pixmap is created in rrCreateSharedPixmap, it has a refcnt
    of 1.  Then, PixmapShareToSlave bumps the refcnt to 2.  However, there's no
    corresponding PixmapUnshareFromSlave where the refcnt can be decreased again,
    and there's no convenient common place where the refcnt can be decremented when
    the slave pixmap is destroyed.
    
    Fix this by just unreffing the pixmap twice in RRCrtcDetachScanoutPixmap.
    
    Signed-off-by: Aaron Plattner <aplattner at nvidia.com>
    Reviewed-by: Dave Airlie <airlied at redhat.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index e82d050..6e2eca5 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -372,6 +372,11 @@ RRCrtcDetachScanoutPixmap(RRCrtcPtr crtc)
     ret = pScrPriv->rrCrtcSetScanoutPixmap(crtc, NULL);
     if (crtc->scanout_pixmap) {
         master->StopPixmapTracking(mscreenpix, crtc->scanout_pixmap);
+        /*
+         * Unref the pixmap twice: once for the original reference, and once
+         * for the reference implicitly added by PixmapShareToSlave.
+         */
+        master->DestroyPixmap(crtc->scanout_pixmap->master_pixmap);
         master->DestroyPixmap(crtc->scanout_pixmap->master_pixmap);
         crtc->pScreen->DestroyPixmap(crtc->scanout_pixmap);
     }
commit e7b4b83679604919035d5aab544092aef5ea6034
Author: Carlos Garnacho <carlosg at gnome.org>
Date:   Wed Feb 6 14:07:22 2013 +0100

    dix: Set focus field on XI2 crossing events
    
    Set on DeviceEnterLeaveEvent() the xXIEnterEvent->focus field
    similarly to how the CoreEnterLeaveEvent() function above does
    for core events.
    
    This fixes bug https://bugzilla.gnome.org/show_bug.cgi?id=677329
    reported to GTK+, where focus handling on window managers with
    sloppy focus or no window manager present was broken due to this
    field being always set to FALSE.
    
    Signed-off-by: Carlos Garnacho <carlosg at gnome.org>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    (cherry picked from commit 509b3c3dc82e7abce1900d5e1cddd90f23be5a87)

diff --git a/dix/events.c b/dix/events.c
index 904f0ba..a43c99a 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -4561,6 +4561,7 @@ DeviceEnterLeaveEvent(DeviceIntPtr mouse,
 {
     GrabPtr grab = mouse->deviceGrab.grab;
     xXIEnterEvent *event;
+    WindowPtr focus;
     int filter;
     int btlen, len, i;
     DeviceIntPtr kbd;
@@ -4602,6 +4603,11 @@ DeviceEnterLeaveEvent(DeviceIntPtr mouse,
         event->group.locked_group = kbd->key->xkbInfo->state.locked_group;
     }
 
+    focus = (kbd) ? kbd->focus->win : None;
+    if ((focus != NoneWin) &&
+        ((pWin == focus) || (focus == PointerRootWin) || IsParent(focus, pWin)))
+        event->focus = TRUE;
+
     FixUpEventFromWindow(mouse->spriteInfo->sprite, (xEvent *) event, pWin,
                          None, FALSE);
 
commit 29a0c87f4d235898a526758b34c2abfdb656cdf4
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Jan 25 11:47:32 2013 +1000

    dix: when shutting down slave devices, shut down xtest devices last
    
    XTest devices are the first ones in the list, being initialised together
    with the master devices. If we disable the devices in-order and a device has
    a button down when being disabled, the XTest device is checked for a
    required button release (xkbAccessX.c's ProcessPointerEvent). This fails if
    the device is already NULL.
    
    Instead of putting the check there, disable the devices in the reverse order
    they are initialised. Disable physical slaves first, then xtest devices,
    then the master devices.
    
    Testcase: shut down server with a button still held down on a physical
    device
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit 3e4be4033aed78b2bb3a18d51f0963989efd1af3)

diff --git a/dix/devices.c b/dix/devices.c
index fd4916a..7d7888e 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -514,6 +514,12 @@ DisableAllDevices(void)
 {
     DeviceIntPtr dev, tmp;
 
+    /* Disable slave devices first, excluding XTest devices */
+    nt_list_for_each_entry_safe(dev, tmp, inputInfo.devices, next) {
+        if (!IsXTestDevice(dev, NULL) && !IsMaster(dev))
+            DisableDevice(dev, FALSE);
+    }
+    /* Disable XTest devices */
     nt_list_for_each_entry_safe(dev, tmp, inputInfo.devices, next) {
         if (!IsMaster(dev))
             DisableDevice(dev, FALSE);
commit d8a09a4b15a6830b3fd281540015015a5663952e
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Jan 11 14:22:07 2013 +1000

    dix: pre-scale relative events from abs devices to desktop ratio (#31636)
    
    Absolute devices may send relative events depending on the mode (synaptics
    by default, wacom per option). The relative events are added to the previous
    position, converted into device coordinates and then scaled into desktop
    coordinates for pointer movement.
    
    Because the device range must be mapped into the desktop coordinate range,
    this results in uneven scaling depending dimensions, e.g. on a setup with
    width == 2 * height, a relative movement of 10/10 in device coordinates
    results in a cursor movement of 20/10 (+ acceleration)
    
    Other commonly user-visible results:
    * the touchpad changing acceleration once an external monitor as added.
    * drawing a circle on a wacom tablet in relative mode gives an ellipsis in
      the same ratio as the desktop dimensions.
    
    Solution: pre-scale the incoming relative x/y coordinates by width/height
    ratio of the total desktop size. Then add them to the previous
    coordinates and scale back with the previous mapping, which will undo the
    pre-scaling and give us the right movement.
    
    X.Org Bug 31636 <http://bugs.freedesktop.org/show_bug.cgi?id=31636>
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit 61a99aff9d33728a0b67920254d2d4d79f80cf39)

diff --git a/dix/getevents.c b/dix/getevents.c
index bf87ffa..7076783 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -787,11 +787,33 @@ add_to_scroll_valuator(DeviceIntPtr dev, ValuatorMask *mask, int valuator, doubl
  * @param[in,out] mask Valuator data for this event, modified in-place.
  */
 static void
-moveRelative(DeviceIntPtr dev, ValuatorMask *mask)
+moveRelative(DeviceIntPtr dev, int flags, ValuatorMask *mask)
 {
     int i;
     Bool clip_xy = IsMaster(dev) || !IsFloating(dev);
 
+    /* for abs devices in relative mode, we've just scaled wrong, since we
+       mapped the device's shape into the screen shape. Undo this. */
+    if ((flags & POINTER_ABSOLUTE) == 0 && dev->valuator &&
+        dev->valuator->axes[0].min_value < dev->valuator->axes[0].max_value) {
+
+        double ratio = 1.0 * screenInfo.width/screenInfo.height;
+
+        if (ratio > 1.0) {
+            double y;
+            if (valuator_mask_fetch_double(mask, 1, &y)) {
+                y *= ratio;
+                valuator_mask_set_double(mask, 1, y);
+            }
+        } else {
+            double x;
+            if (valuator_mask_fetch_double(mask, 0, &x)) {
+                x *= ratio;
+                valuator_mask_set_double(mask, 0, x);
+            }
+        }
+    }
+
     /* calc other axes, clip, drop back into valuators */
     for (i = 0; i < valuator_mask_size(mask); i++) {
         double val = dev->last.valuators[i];
@@ -1387,7 +1409,7 @@ fill_pointer_events(InternalEvent *events, DeviceIntPtr pDev, int type,
         if ((flags & POINTER_NORAW) == 0)
             set_raw_valuators(raw, &mask, raw->valuators.data);
 
-        moveRelative(pDev, &mask);
+        moveRelative(pDev, flags, &mask);
     }
 
     /* valuators are in device coordinate system in absolute coordinates */
commit 79f5430ba62e0020cb19e4ce72599a220d0bb2f9
Author: Sybren van Elderen <sowmestno at msn.com>
Date:   Tue Jan 29 15:43:57 2013 +1000

    dix: when scaling from desktop coord, take the total desktop size (#51904)
    
    Scaled is already in desktop coordinates, take the total width into account,
    not just the current screen's width.
    
    Fixes Xdmx pointer position calculation.
    
    X.Org Bug 51904 <http://bugs.freedesktop.org/show_bug.cgi?id=51904>
    
    Signed-off-by: Sybren van Elderen <sowmestno at msn.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    (cherry picked from commit a191dbfe850ed9c6440346f59cb0078e0e844edc)

diff --git a/dix/getevents.c b/dix/getevents.c
index 241fcfd..bf87ffa 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -844,14 +844,14 @@ scale_from_screen(DeviceIntPtr dev, ValuatorMask *mask)
         scaled = valuator_mask_get_double(mask, 0) + scr->x;
         scaled = rescaleValuatorAxis(scaled,
                                      NULL, dev->valuator->axes + 0,
-                                     0, scr->width);
+                                     screenInfo.x, screenInfo.width);
         valuator_mask_set_double(mask, 0, scaled);
     }
     if (valuator_mask_isset(mask, 1)) {
         scaled = valuator_mask_get_double(mask, 1) + scr->y;
         scaled = rescaleValuatorAxis(scaled,
                                      NULL, dev->valuator->axes + 1,
-                                     0, scr->height);
+                                     screenInfo.y, screenInfo.height);
         valuator_mask_set_double(mask, 1, scaled);
     }
 }
commit fa6cbd099f65eea46e41ecffcc46135bae2face8
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Sat Jan 26 14:13:33 2013 +1000

    dmx: don't include dmx-config.h from xdmxconfig (#37502)
    
    dmx-config.h is a server header which includes dix-config.h. That again
    defines a bunch of server-specifics, including setting the size of XID to
    32 bit.
    
    libX11 uses unsigned long (8 bits on x86_64). XGCValues thus ends up being
    16 bytes smaller in xdmxconfig than in the library, causing garbage to be
    sent to the server.
    
    X.Org Bug 37502 <http://bugs.freedesktop.org/show_bug.cgi?id=37502>
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit 1058fcf57fdcb94d92e7b5f4483b347853d5f8e6)

diff --git a/hw/dmx/config/xdmxconfig.c b/hw/dmx/config/xdmxconfig.c
index f308412..2121dd7 100644
--- a/hw/dmx/config/xdmxconfig.c
+++ b/hw/dmx/config/xdmxconfig.c
@@ -31,9 +31,6 @@
  *
  */
 
-#ifdef HAVE_DMX_CONFIG_H
-#include <dmx-config.h>
-#endif
 
 #include <stdio.h>
 #include <stdlib.h>
commit 63f928a9d702512db4c1e683c3b772a4d1f32010
Author: Daniel Martin <consume.noise at gmail.com>
Date:   Fri Dec 7 19:38:55 2012 +0100

    xfixes: Fix minor number in QueryVersion
    
    Due to a typo the major version number was passed as minor version to
    version_compare().
    
    Regression-from: ffd4874798ba54f86acac75779a15b4babeaa5f3
    
    Signed-off-by: Daniel Martin <consume.noise at gmail.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    (cherry picked from commit 36740d02b9ca117f1404e077367fbbbe271a17d6)

diff --git a/xfixes/xfixes.c b/xfixes/xfixes.c
index 52c57df..48af9ea 100644
--- a/xfixes/xfixes.c
+++ b/xfixes/xfixes.c
@@ -74,7 +74,7 @@ ProcXFixesQueryVersion(ClientPtr client)
 
     if (version_compare(stuff->majorVersion, stuff->minorVersion,
                         SERVER_XFIXES_MAJOR_VERSION,
-                        SERVER_XFIXES_MAJOR_VERSION) < 0) {
+                        SERVER_XFIXES_MINOR_VERSION) < 0) {
         rep.majorVersion = stuff->majorVersion;
         rep.minorVersion = stuff->minorVersion;
     }
commit bc4c3158ba3ef438426a2376f20f97d7f266828c
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Tue Dec 4 15:28:14 2012 +1000

    xkb: only post a XTest release if the XTest device has the button down
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    (cherry picked from commit 5daa442fe15d9a87112a2def673c99a5f2506dcf)

diff --git a/xkb/xkbAccessX.c b/xkb/xkbAccessX.c
index 9631502..13051e0 100644
--- a/xkb/xkbAccessX.c
+++ b/xkb/xkbAccessX.c
@@ -732,8 +732,13 @@ ProcessPointerEvent(InternalEvent *ev, DeviceIntPtr mouse)
             if (rc != Success)
                 ErrorF("[xkb] bad sourceid '%d' on button release event.\n",
                         event->sourceid);
-            else if (!IsXTestDevice(source, GetMaster(dev, MASTER_POINTER)))
-                XkbFakeDeviceButton(dev, FALSE, event->detail.key);
+            else if (!IsXTestDevice(source, GetMaster(dev, MASTER_POINTER))) {
+                DeviceIntPtr xtest_device;
+
+                xtest_device = GetXTestDevice(GetMaster(dev, MASTER_POINTER));
+                if (button_is_down(xtest_device, ev->device_event.detail.button, BUTTON_PROCESSED))
+                    XkbFakeDeviceButton(dev, FALSE, event->detail.key);
+            }
         }
 
         if (xkbi)
commit b3b7be7d49ee9a253062661d6c72fa1f8ddff493
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Tue Dec 4 15:03:37 2012 +1000

    xkb: always post XTest button up when the physical button released (#28808)
    
    Regression introduced by commit 2decff6393a44b56d80d53570718f95354fde454
      xkb: ProcesssPointerEvent must work on the VCP if it gets the VCP
    
    XTest buttons must be released when a physical button is released. This was
    fixed in 14327858391ebe929b806efb53ad79e789361883, but
    2decff6393a44b56d80d53570718f95354fde454 changed a condition that this code
    didn't get triggered anymore.
    
    "dev" for pointer events is now always the VCP which doesn't have a xkbi
    struct. So move this condition out and always trigger the XTest released for
    button events.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Tested-by: Frank Roscher <Frank-Roscher at gmx.net>
    (cherry picked from commit c4fee9d2ecd6fdd4c05b04c9f02b23f10f2938b8)

diff --git a/xkb/xkbAccessX.c b/xkb/xkbAccessX.c
index 21df85d..9631502 100644
--- a/xkb/xkbAccessX.c
+++ b/xkb/xkbAccessX.c
@@ -723,23 +723,22 @@ ProcessPointerEvent(InternalEvent *ev, DeviceIntPtr mouse)
         changed |= XkbPointerButtonMask;
     }
     else if (event->type == ET_ButtonRelease) {
-        if (xkbi) {
-            xkbi->lockedPtrButtons &= ~(1 << (event->detail.key & 0x7));
-
-            if (IsMaster(dev)) {
-                DeviceIntPtr source;
-                int rc;
-
-                rc = dixLookupDevice(&source, event->sourceid, serverClient,
-                                     DixWriteAccess);
-                if (rc != Success)
-                    ErrorF("[xkb] bad sourceid '%d' on button release event.\n",
-                           event->sourceid);
-                else if (!IsXTestDevice(source, GetMaster(dev, MASTER_POINTER)))
-                    XkbFakeDeviceButton(dev, FALSE, event->detail.key);
-            }
+        if (IsMaster(dev)) {
+            DeviceIntPtr source;
+            int rc;
+
+            rc = dixLookupDevice(&source, event->sourceid, serverClient,
+                    DixWriteAccess);
+            if (rc != Success)
+                ErrorF("[xkb] bad sourceid '%d' on button release event.\n",
+                        event->sourceid);
+            else if (!IsXTestDevice(source, GetMaster(dev, MASTER_POINTER)))
+                XkbFakeDeviceButton(dev, FALSE, event->detail.key);
         }
 
+        if (xkbi)
+            xkbi->lockedPtrButtons &= ~(1 << (event->detail.key & 0x7));
+
         changed |= XkbPointerButtonMask;
     }
 


More information about the xorg-commit mailing list