xserver: Branch 'master' - 4 commits

Keith Packard keithp at kemper.freedesktop.org
Fri May 25 18:49:36 PDT 2012


 Xext/hashtable.c               |    4 +
 Xi/stubs.c                     |    1 
 hw/vfb/InitOutput.c            |    7 +++
 hw/xfree86/common/xf86Xinput.c |   94 ++++++++++++++++++++++++++++++++++-------
 4 files changed, 90 insertions(+), 16 deletions(-)

New commits:
commit 594b4a4f0601066d09e49a84c5af8c2eb6f07240
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Thu May 24 13:34:11 2012 +1000

    Xext: include dix-config.h
    
    silences
    In file included from ../include/misc.h:111:0, from hashtable.c:2:
    ./include/os.h:559:1: warning: redundant redeclaration of 'strndup' [-Wredundant-decls]
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>

diff --git a/Xext/hashtable.c b/Xext/hashtable.c
index 2adf92e..9d9ef89 100644
--- a/Xext/hashtable.c
+++ b/Xext/hashtable.c
@@ -1,3 +1,7 @@
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
 #include <stdlib.h>
 #include "misc.h"
 #include "hashtable.h"
commit d348ab06aae21c153ecbc3511aeafc8ab66d8303
Author: Julien Cristau <jcristau at debian.org>
Date:   Fri May 11 21:31:50 2012 +0200

    Xvfb: destroy the screen pixmap in CloseScreen
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/hw/vfb/InitOutput.c b/hw/vfb/InitOutput.c
index e2cd96c..16edf43 100644
--- a/hw/vfb/InitOutput.c
+++ b/hw/vfb/InitOutput.c
@@ -774,6 +774,13 @@ vfbCloseScreen(int index, ScreenPtr pScreen)
     for (i = 0; i < screenInfo.numScreens; i++)
         SetInstalledColormap(screenInfo.screens[i], NULL);
 
+    /*
+     * fb overwrites miCloseScreen, so do this here
+     */
+    if (pScreen->devPrivate)
+        (*pScreen->DestroyPixmap) (pScreen->devPrivate);
+    pScreen->devPrivate = NULL;
+
     return pScreen->CloseScreen(index, pScreen);
 }
 
commit e4153c1d9138ed40de1c615525066a0f5bb599dc
Author: Julien Cristau <jcristau at debian.org>
Date:   Fri May 11 21:31:49 2012 +0200

    Xi: make stub DeleteInputDeviceRequest call RemoveDevice
    
    DeleteInputDeviceRequest is called from CloseDownDevices on reset, so
    call RemoveDevice to avoid leaking devices in Xvfb/Xnest/Xwin.
    
    Signed-off-by: Julien Cristau <jcristau at debian.org>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/Xi/stubs.c b/Xi/stubs.c
index 8baa5a0..39bee7c 100644
--- a/Xi/stubs.c
+++ b/Xi/stubs.c
@@ -141,4 +141,5 @@ NewInputDeviceRequest(InputOption *options, InputAttributes * attrs,
 void
 DeleteInputDeviceRequest(DeviceIntPtr dev)
 {
+    RemoveDevice(dev, TRUE);
 }
commit 2d4fda4b09e67e47d3e6fc4743fc6e81bfe40f28
Author: Marcin Slusarz <marcin.slusarz at gmail.com>
Date:   Mon May 21 21:39:43 2012 +0200

    xfree86: fix mouse wheel support for DGA clients
    
    xf86-input-evdev (since "smooth scrolling" support was added) can send mouse
    motion and wheel events in one batch, so we need to handle it properly.
    Otherwise mouse wheel events which come with motion events are lost
    and separate mouse wheel events are handled through non-DGA path.
    
    Signed-off-by: Marcin Slusarz <marcin.slusarz at gmail.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index 77b8000..bee407b 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -1059,26 +1059,24 @@ xf86PostMotionEventP(DeviceIntPtr device,
     xf86PostMotionEventM(device, is_absolute, &mask);
 }
 
-void
-xf86PostMotionEventM(DeviceIntPtr device,
-                     int is_absolute, const ValuatorMask *mask)
+static int
+xf86CheckMotionEvent4DGA(DeviceIntPtr device, int is_absolute,
+                         const ValuatorMask *mask)
 {
-    int flags = 0;
-
-    if (valuator_mask_num_valuators(mask) > 0) {
-        if (is_absolute)
-            flags = POINTER_ABSOLUTE;
-        else
-            flags = POINTER_RELATIVE | POINTER_ACCELERATE;
-    }
+    int stolen = 0;
 
 #if XFreeXDGA
+    ScreenPtr scr = NULL;
+    int idx, i;
+
     /* The evdev driver may not always send all axes across. */
-    if (valuator_mask_isset(mask, 0) || valuator_mask_isset(mask, 1))
-        if (miPointerGetScreen(device)) {
-            int index = miPointerGetScreen(device)->myNum;
+    if (valuator_mask_isset(mask, 0) || valuator_mask_isset(mask, 1)) {
+        scr = miPointerGetScreen(device);
+        if (scr) {
             int dx = 0, dy = 0;
 
+            idx = scr->myNum;
+
             if (valuator_mask_isset(mask, 0)) {
                 dx = valuator_mask_get(mask, 0);
                 if (is_absolute)
@@ -1091,11 +1089,75 @@ xf86PostMotionEventM(DeviceIntPtr device,
                     dy -= device->last.valuators[1];
             }
 
-            if (DGAStealMotionEvent(device, index, dx, dy))
-                return;
+            if (DGAStealMotionEvent(device, idx, dx, dy))
+                stolen = 1;
+        }
+    }
+
+    for (i = 2; i < valuator_mask_size(mask); i++) {
+        AxisInfoPtr ax;
+        double incr;
+        int val, button;
+
+        if (i >= device->valuator->numAxes)
+            break;
+
+        if (!valuator_mask_isset(mask, i))
+            continue;
+
+        ax = &device->valuator->axes[i];
+
+        if (ax->scroll.type == SCROLL_TYPE_NONE)
+            continue;
+
+        if (!scr) {
+            scr = miPointerGetScreen(device);
+            if (!scr)
+                break;
+            idx = scr->myNum;
+        }
+
+        incr = ax->scroll.increment;
+        val = valuator_mask_get(mask, i);
+
+        if (ax->scroll.type == SCROLL_TYPE_VERTICAL) {
+            if (incr * val < 0)
+                button = 4; /* up */
+            else
+                button = 5; /* down */
+        } else { /* SCROLL_TYPE_HORIZONTAL */
+            if (incr * val < 0)
+                button = 6; /* left */
+            else
+                button = 7; /* right */
         }
+
+        if (DGAStealButtonEvent(device, idx, button, 1) &&
+                DGAStealButtonEvent(device, idx, button, 0))
+            stolen = 1;
+    }
+
 #endif
 
+    return stolen;
+}
+
+void
+xf86PostMotionEventM(DeviceIntPtr device,
+                     int is_absolute, const ValuatorMask *mask)
+{
+    int flags = 0;
+
+    if (xf86CheckMotionEvent4DGA(device, is_absolute, mask))
+        return;
+
+    if (valuator_mask_num_valuators(mask) > 0) {
+        if (is_absolute)
+            flags = POINTER_ABSOLUTE;
+        else
+            flags = POINTER_RELATIVE | POINTER_ACCELERATE;
+    }
+
     QueuePointerEvents(device, MotionNotify, 0, flags, mask);
 }
 


More information about the xorg-commit mailing list