xserver: Branch 'master' - 7 commits

Peter Hutterer whot at kemper.freedesktop.org
Mon Jun 2 00:24:51 PDT 2008


 config/hal.c                   |    2 +-
 dix/devices.c                  |    3 +++
 dix/getevents.c                |    2 ++
 hw/kdrive/ephyr/ephyr.c        |    8 +++++---
 hw/kdrive/ephyr/ephyrinit.c    |    8 +++++++-
 hw/kdrive/src/kinput.c         |   16 ++++++++++------
 hw/xfree86/common/xf86Xinput.c |   37 +++++++++++++++++++------------------
 include/xkbsrv.h               |    4 ++++
 xkb/xkbInit.c                  |   15 +++++++++++++++
 9 files changed, 66 insertions(+), 29 deletions(-)

New commits:
commit 26e7e69ab893d1f2b35213250ada40ec90944f62
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Mon Jun 2 11:04:41 2008 +0930

    kdrive: don't post motion event if there was no motion. #16179
    
    Based on the patch by Tomas Janousek.
    
    X.Org Bug 16179 <http://bugs.freedesktop.org/show_bug.cgi?id=16179>

diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c
index 5c686b6..3f81b65 100644
--- a/hw/kdrive/src/kinput.c
+++ b/hw/kdrive/src/kinput.c
@@ -2074,7 +2074,7 @@ KdEnqueuePointerEvent(KdPointerInfo *pi, unsigned long flags, int rx, int ry,
     int           (*matrix)[3] = kdPointerMatrix.matrix;
     unsigned long button;
     int           n;
-    int           dixflags;
+    int           dixflags = 0;
 
     if (!pi)
 	return;
@@ -2105,11 +2105,15 @@ KdEnqueuePointerEvent(KdPointerInfo *pi, unsigned long flags, int rx, int ry,
     z = rz;
 
     if (flags & KD_MOUSE_DELTA)
-        dixflags = POINTER_RELATIVE & POINTER_ACCELERATE;
-    else
-        dixflags = POINTER_ABSOLUTE;
-
-    _KdEnqueuePointerEvent(pi, MotionNotify, x, y, z, 0, dixflags, FALSE);
+    {
+        if (x || y || z)
+            dixflags = POINTER_RELATIVE & POINTER_ACCELERATE;
+    } else if (x != pi->dixdev->last.valuators[0] ||
+                y != pi->dixdev->last.valuators[1])
+            dixflags = POINTER_ABSOLUTE;
+
+    if (dixflags)
+        _KdEnqueuePointerEvent(pi, MotionNotify, x, y, z, 0, dixflags, FALSE);
 
     buttons = flags;
 
commit ac1db454497ff1839aa7f7ee0649ede112824ed9
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Mon Jun 2 10:40:10 2008 +0930

    xfree86: suspend signals while removing a device (corrected version).
    
    Block/Release is now symmetrical.

diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index efebf19..c6a4ef6 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -475,28 +475,31 @@ DeleteInputDeviceRequest(DeviceIntPtr pDev)
         drv = pInfo->drv;
         idev = pInfo->conf_idev;
     }
-    RemoveDevice(pDev);
 
-    if (pDev->isMaster)
-        return;
+    OsBlockSignals();
+    RemoveDevice(pDev);
 
-    if(drv->UnInit)
-        drv->UnInit(drv, pInfo, 0);
-    else
-        xf86DeleteInput(pInfo, 0);
+    if (!pDev->isMaster)
+    {
+        if(drv->UnInit)
+            drv->UnInit(drv, pInfo, 0);
+        else
+            xf86DeleteInput(pInfo, 0);
 
-    /* devices added through HAL aren't in the config layout */
-    it = xf86ConfigLayout.inputs;
-    while(*it && *it != idev)
-        it++;
+        /* devices added through HAL aren't in the config layout */
+        it = xf86ConfigLayout.inputs;
+        while(*it && *it != idev)
+            it++;
 
-    if (!(*it)) /* end of list, not in the layout */
-    {
-        xfree(idev->driver);
-        xfree(idev->identifier);
-        xf86optionListFree(idev->commonOptions);
-        xfree(idev);
+        if (!(*it)) /* end of list, not in the layout */
+        {
+            xfree(idev->driver);
+            xfree(idev->identifier);
+            xf86optionListFree(idev->commonOptions);
+            xfree(idev);
+        }
     }
+    OsReleaseSignals();
 }
 
 /* 
commit 95ecaa411aefbcd8e2e00814132cb07b4be4e5bf
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Mon Jun 2 10:38:45 2008 +0930

    Revert "xfree86: suspend signals while removing a device."
    
    Left the signals blocked hanging after removing a master device.
    
    This reverts commit 74372fd0049676787904f1f9f80f836b97f5f60e.

diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index 2ae4630..efebf19 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -475,7 +475,6 @@ DeleteInputDeviceRequest(DeviceIntPtr pDev)
         drv = pInfo->drv;
         idev = pInfo->conf_idev;
     }
-    OsBlockSignals();
     RemoveDevice(pDev);
 
     if (pDev->isMaster)
@@ -485,7 +484,6 @@ DeleteInputDeviceRequest(DeviceIntPtr pDev)
         drv->UnInit(drv, pInfo, 0);
     else
         xf86DeleteInput(pInfo, 0);
-    OsReleaseSignals();
 
     /* devices added through HAL aren't in the config layout */
     it = xf86ConfigLayout.inputs;
commit 5ba07cb54803b8c63e25e8ca1f1787860f684612
Author: Tiago Vignatti <vignatti at c3sl.ufpr.br>
Date:   Sun Jun 1 18:31:52 2008 -0300

    kdrive: changes ephyr API according mpx merge.
    
    This fix host-cursor in Xephyr server.
    
    Signed-off-by: Tiago Vignatti <vignatti at c3sl.ufpr.br>
    Signed-off-by: Peter Hutterer <peter at cs.unisa.edu.au>

diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c
index d0fa998..e5b16c9 100644
--- a/hw/kdrive/ephyr/ephyr.c
+++ b/hw/kdrive/ephyr/ephyr.c
@@ -837,7 +837,7 @@ ephyrCrossScreen (ScreenPtr pScreen, Bool entering)
 int ephyrCurScreen; /*current event screen*/
 
 static void
-ephyrWarpCursor (ScreenPtr pScreen, int x, int y)
+ephyrWarpCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
 {
     ephyrBlockSigio ();
     ephyrCurScreen = pScreen->myNum;
@@ -849,7 +849,9 @@ miPointerScreenFuncRec ephyrPointerScreenFuncs =
 {
   ephyrCursorOffScreen,
   ephyrCrossScreen,
-  ephyrWarpCursor
+  ephyrWarpCursor,
+  NULL,
+  NULL
 };
 
 #ifdef XF86DRI
@@ -911,7 +913,7 @@ ephyrPoll(void)
                   if (ev.data.mouse_motion.screen >= 0)
                     {
                       ephyrWarpCursor
-                            (screenInfo.screens[ev.data.mouse_motion.screen],
+                            (inputInfo.pointer, screenInfo.screens[ev.data.mouse_motion.screen],
                              ev.data.mouse_motion.x,
                              ev.data.mouse_motion.y );
                     }
diff --git a/hw/kdrive/ephyr/ephyrinit.c b/hw/kdrive/ephyr/ephyrinit.c
index e00791c..1ec98fc 100644
--- a/hw/kdrive/ephyr/ephyrinit.c
+++ b/hw/kdrive/ephyr/ephyrinit.c
@@ -290,12 +290,18 @@ ephyrMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
   ;
 }
 
+static Bool
+ephyrDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen)
+{
+  return TRUE;
+}
+
 miPointerSpriteFuncRec EphyrPointerSpriteFuncs = {
 	ephyrRealizeCursor,
 	ephyrUnrealizeCursor,
 	ephyrSetCursor,
 	ephyrMoveCursor,
-        NULL,
+    ephyrDeviceCursorInitialize,
         NULL
 };
 
commit 5a3d06b8f42473cea3741dc722a775deaa2b73f6
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Sun Jun 1 15:20:42 2008 +0930

    xkb: delete default rules when devices are closed.
    
    We only have one set of default rules options in xkb. When the second keyboard
    is brought up with Xkb options specified, these new options overwrite the old.
    In future server generations, the rules used for the VCK are a mixture of the
    default ones and ones previously specified for other keyboards. Simply
    resetting the xkb default rules to NULL avoids this issue.
    
    Reproducable by setting XkbLayout "de" and XkbVariant "nodeadkeys". In the
    second server generation, the VCK has "us(nodeadkeys)". This again produces a
    SIGABRT when the first key is hit.
    
    I could not figure out why the SIGABRT happens. This patch is avoiding the
    issue rather than fixing it.

diff --git a/dix/devices.c b/dix/devices.c
index 08520eb..efdc0c9 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -847,6 +847,9 @@ CloseDownDevices(void)
     inputInfo.off_devices = NULL;
     inputInfo.keyboard = NULL;
     inputInfo.pointer = NULL;
+#ifdef XKB
+    XkbDeleteRulesDflts();
+#endif
 }
 
 /**
diff --git a/include/xkbsrv.h b/include/xkbsrv.h
index 7db9eef..e2fff4e 100644
--- a/include/xkbsrv.h
+++ b/include/xkbsrv.h
@@ -899,6 +899,10 @@ extern	void	XkbSetRulesDflts(
 	char *			/* options */
 );
 
+extern	void	XkbDeleteRulesDflts(
+	void
+);
+
 extern	void	XkbInitDevice(
 	DeviceIntPtr 	/* pXDev */
 );
diff --git a/xkb/xkbInit.c b/xkb/xkbInit.c
index 0d5d15e..47ad553 100644
--- a/xkb/xkbInit.c
+++ b/xkb/xkbInit.c
@@ -279,6 +279,21 @@ XkbSetRulesDflts(char *rulesFile,char *model,char *layout,
     return;
 }
 
+void
+XkbDeleteRulesDflts()
+{
+    _XkbFree(XkbRulesFile);
+    XkbRulesFile = NULL;
+    _XkbFree(XkbModelDflt);
+    XkbModelDflt = NULL;
+    _XkbFree(XkbLayoutDflt);
+    XkbLayoutDflt = NULL;
+    _XkbFree(XkbVariantDflt);
+    XkbVariantDflt = NULL;
+    _XkbFree(XkbOptionsDflt);
+    XkbOptionsDflt = NULL;
+}
+
 /***====================================================================***/
 
 #include "xkbDflts.h"
commit 5ebe76f13fb6e96cebe5a386024a73eceeb828ff
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Sat May 31 22:13:03 2008 +0930

    config: init dev to NULL to shut up a valgrind warning.

diff --git a/config/hal.c b/config/hal.c
index 1d62a1d..f4eb438 100644
--- a/config/hal.c
+++ b/config/hal.c
@@ -173,7 +173,7 @@ device_added(LibHalContext *hal_ctx, const char *udi)
 {
     char *path = NULL, *driver = NULL, *name = NULL, *config_info = NULL;
     InputOption *options = NULL, *tmpo = NULL;
-    DeviceIntPtr dev;
+    DeviceIntPtr dev = NULL;
     DBusError error;
     struct xkb_options xkb_opts = {0};
 
commit a7ae9cbd78193fdafcafd5d7af1f6fabbb434628
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Sat May 31 20:44:58 2008 +0930

    dix: don't read valuators past numAxes.

diff --git a/dix/getevents.c b/dix/getevents.c
index 37bd203..fc07496 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -428,6 +428,8 @@ updateMotionHistory(DeviceIntPtr pDev, CARD32 ms, int first_valuator,
 
         for (i = first_valuator; i < first_valuator + num_valuators; i++)
         {
+            if (i >= v->numAxes)
+                break;
             memcpy(buff, &v->axes[i].min_value, sizeof(INT32));
             buff += sizeof(INT32);
             memcpy(buff, &v->axes[i].max_value, sizeof(INT32));


More information about the xorg-commit mailing list