xserver: Branch 'master' - 5 commits

Peter Hutterer whot at kemper.freedesktop.org
Wed Jun 11 00:55:30 PDT 2008


 Xext/xtest.c                   |    2 +-
 dix/events.c                   |    1 +
 hw/xfree86/common/xf86Xinput.c |    4 ++--
 hw/xnest/Cursor.c              |   26 ++++++++++++++++++++++++++
 hw/xnest/Screen.c              |   13 ++++++++++---
 hw/xnest/XNCursor.h            |   12 +++++++++++-
 mi/mipointrst.h                |    4 ++++
 7 files changed, 55 insertions(+), 7 deletions(-)

New commits:
commit 6528eb885dea0326aacdd026d44d82ab07f4a4fd
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Wed Jun 11 15:01:36 2008 +0930

    Xext: init firstValuator to zero, otherwise core XTest events may get lost.

diff --git a/Xext/xtest.c b/Xext/xtest.c
index ad70aa8..8e96f65 100644
--- a/Xext/xtest.c
+++ b/Xext/xtest.c
@@ -167,7 +167,7 @@ ProcXTestFakeInput(client)
     deviceValuator *dv = NULL;
     int valuators[MAX_VALUATORS] = {0};
     int numValuators = 0;
-    int firstValuator;
+    int firstValuator = 0;
     EventListPtr events;
     int nevents;
     int i;
commit 6ab311c92d036dc63ee92ab4bb231f5f61ebe69f
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Mon Jun 9 11:45:57 2008 +0930

    dix: Call RealizeCursor during InitializeSprite.
    
    RealizeCursor should be called when the cursor is allocated. However, when the
    root cursor is allocated, no devices exist yet, and thus RealizeCursor is
    never called. This may lead to segfaults lateron in DDXes like Xnest that
    actually need to do something for each cursor, and lateron rely on that
    DDX-specific data for each cursor has been initialized.

diff --git a/dix/events.c b/dix/events.c
index 79d9373..8191973 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -2950,6 +2950,7 @@ InitializeSprite(DeviceIntPtr pDev, WindowPtr pWin)
 
     if (pScreen)
     {
+        (*pScreen->RealizeCursor) ( pDev, pScreen, pSprite->current);
         (*pScreen->CursorLimits) ( pDev, pScreen, pSprite->current,
                                    &pSprite->hotLimits, &pSprite->physLimits);
         pSprite->confined = FALSE;
commit e083b5a07507d53de0d1d365ef1565346284c997
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Mon Jun 9 11:23:53 2008 +0930

    xnest: wrap the xnest cursor sprite funcs around the mi funcs.
    
    Modelled after the xfree86 code. Call miDCInitialize to init the SW rendering
    engine, then take the pointers, store it in a xnest-local variable, and put
    the xnest-specific sprite funcs in place. In the xnest sprite funcs, call
    through to the mi sprite funcs after doing xnest-specific stuff.

diff --git a/hw/xnest/Cursor.c b/hw/xnest/Cursor.c
index 3e676d1..12f47e7 100644
--- a/hw/xnest/Cursor.c
+++ b/hw/xnest/Cursor.c
@@ -25,6 +25,7 @@ is" without express or implied warranty.
 #include "cursorstr.h"
 #include "scrnintstr.h"
 #include "servermd.h"
+#include "mipointrst.h"
 
 #include "Xnest.h"
 
@@ -35,6 +36,8 @@ is" without express or implied warranty.
 #include "Keyboard.h"
 #include "Args.h"
 
+xnestCursorFuncRec xnestCursorFuncs = {NULL};
+
 Bool
 xnestRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
 {
@@ -155,3 +158,26 @@ void
 xnestMoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
 {
 }
+
+Bool
+xnestDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen)
+{
+    xnestCursorFuncPtr pScreenPriv;
+
+    pScreenPriv = (xnestCursorFuncPtr)
+            dixLookupPrivate(&pScreen->devPrivates, xnestCursorScreenKey);
+
+    pScreenPriv->spriteFuncs->DeviceCursorInitialize(pDev, pScreen);
+    return TRUE;
+}
+
+void
+xnestDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScreen)
+{
+    xnestCursorFuncPtr pScreenPriv;
+
+    pScreenPriv = (xnestCursorFuncPtr)
+            dixLookupPrivate(&pScreen->devPrivates, xnestCursorScreenKey);
+
+    pScreenPriv->spriteFuncs->DeviceCursorCleanup(pDev, pScreen);
+}
diff --git a/hw/xnest/Screen.c b/hw/xnest/Screen.c
index 9d157a3..1c129e7 100644
--- a/hw/xnest/Screen.c
+++ b/hw/xnest/Screen.c
@@ -41,9 +41,11 @@ is" without express or implied warranty.
 #include "Init.h"
 #include "mipointer.h"
 #include "Args.h"
+#include "mipointrst.h"
 
 Window xnestDefaultWindows[MAXSCREENS];
 Window xnestScreenSaverWindows[MAXSCREENS];
+DevPrivateKey xnestCursorScreenKey = &xnestCursorScreenKey;
 
 ScreenPtr
 xnestScreen(Window window)
@@ -124,8 +126,8 @@ static miPointerSpriteFuncRec xnestPointerSpriteFuncs =
     xnestUnrealizeCursor,
     xnestSetCursor,
     xnestMoveCursor,
-    NULL,
-    NULL
+    xnestDeviceCursorInitialize,
+    xnestDeviceCursorCleanup
 };
 
 Bool
@@ -141,6 +143,7 @@ xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[])
   XSizeHints sizeHints;
   VisualID defaultVisual;
   int rootDepth;
+  miPointerScreenPtr PointPriv;
 
   if (!dixRequestPrivate(xnestWindowPrivateKey, sizeof(xnestPrivWin)))
       return False;
@@ -307,7 +310,11 @@ xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[])
   pScreen->blockData = NULL;
   pScreen->wakeupData = NULL;
 
-  miDCInitialize (pScreen, &xnestPointerCursorFuncs);
+  miDCInitialize(pScreen, &xnestPointerCursorFuncs); /* init SW rendering */
+  PointPriv = dixLookupPrivate(&pScreen->devPrivates, miPointerScreenKey);
+  xnestCursorFuncs.spriteFuncs = PointPriv->spriteFuncs;
+  dixSetPrivate(&pScreen->devPrivates, xnestCursorScreenKey, &xnestCursorFuncs);
+  PointPriv->spriteFuncs = &xnestPointerSpriteFuncs;
 
   pScreen->mmWidth = xnestWidth * DisplayWidthMM(xnestDisplay, 
 		       DefaultScreen(xnestDisplay)) / 
diff --git a/hw/xnest/XNCursor.h b/hw/xnest/XNCursor.h
index 627be03..d993555 100644
--- a/hw/xnest/XNCursor.h
+++ b/hw/xnest/XNCursor.h
@@ -15,6 +15,15 @@ is" without express or implied warranty.
 #ifndef XNESTCURSOR_H
 #define XNESTCURSOR_H
 
+#include "mipointrst.h"
+
+typedef struct {
+    miPointerSpriteFuncPtr spriteFuncs;
+} xnestCursorFuncRec, *xnestCursorFuncPtr;
+
+extern DevPrivateKey xnestCursorScreenKey;
+extern xnestCursorFuncRec xnestCursorFuncs;
+
 typedef struct {
   Cursor cursor;
 } xnestPrivCursor;
@@ -44,5 +53,6 @@ void xnestSetCursor (DeviceIntPtr pDev,
 void xnestMoveCursor (DeviceIntPtr pDev,
                       ScreenPtr pScreen,
                       int x, int y);
-
+Bool xnestDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen);
+void xnestDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScreen);
 #endif /* XNESTCURSOR_H */
commit ea6a02c048e8589e99ee3b459f3612eb3d041558
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Mon Jun 9 11:22:33 2008 +0930

    mi: protect mipointrst.h against multiple includes.

diff --git a/mi/mipointrst.h b/mi/mipointrst.h
index a80c52e..bd9c24a 100644
--- a/mi/mipointrst.h
+++ b/mi/mipointrst.h
@@ -29,6 +29,9 @@ used in advertising or otherwise to promote the sale, use or other dealings
 in this Software without prior written authorization from The Open Group.
 */
 
+#ifndef MIPOINTRST_H
+#define MIPOINTRST_H
+
 #include "mipointer.h"
 #include "scrnintstr.h"
 
@@ -50,3 +53,4 @@ typedef struct {
     Bool		    waitForUpdate;	/* don't move cursor in SIGIO */
     Bool		    showTransparent;	/* show empty cursors */
 } miPointerScreenRec, *miPointerScreenPtr;
+#endif /* MIPOINTRST_H */
commit a3a7c12fcf8e4ac1418f9ea53f76091f309a721b
Author: Peter Hutterer <peter at cs.unisa.edu.au>
Date:   Sun Jun 8 23:38:45 2008 +0930

    xfree86: Fix up xf86ScaleAxis
    
    Some driver still call it, so we might as well work correctly. Always
    resetting X to the Sxhigh is sub-optimal.

diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index c6a4ef6..675ec9f 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -785,9 +785,9 @@ xf86ScaleAxis(int	Cx,
 	ErrorF ("Divide by Zero in xf86ScaleAxis");
     }
     
-    if (X > Sxlow)
+    if (X > Sxhigh)
 	X = Sxlow;
-    if (X < Sxhigh)
+    if (X < Sxlow)
 	X = Sxhigh;
     
     return (X);


More information about the xorg-commit mailing list