xserver: Branch 'master' - 2 commits

Keith Packard keithp at kemper.freedesktop.org
Thu Jul 1 21:50:37 PDT 2010


 hw/xfree86/ramdac/xf86Cursor.c |   12 ++++--------
 mi/mipointer.c                 |   16 ++++++++++++++++
 mi/mipointer.h                 |    5 +++++
 xkb/xkbActions.c               |    6 ++++++
 4 files changed, 31 insertions(+), 8 deletions(-)

New commits:
commit f0fcffe55f280add5e4db2f5e9198a48c6f1b015
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Thu Jun 3 19:00:54 2010 -0700

    Update the sprite immediately when moving it with MouseKeys
    
    Fix for OpenSolaris bug 6949755: Mouse Keys are ununusable
    and possibly https://bugs.freedesktop.org/show_bug.cgi?id=24856
    
    Ensures waitForUpdate is False before calling SetCursorPosition.
    Normally waitForUpdate is False when SilkenMouse is active, True
    when it's not.   When it's True, the mouse cursor position on
    screen is not updated immediately.
    
    This is more critical on Solaris, since we disabled SigIO, thus in turn
    disable SilkenMouse, due to the SSE2 vs. signal handler issues described in
    Sun bugs 6849925, 6859428, and 6879897.
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.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/xkb/xkbActions.c b/xkb/xkbActions.c
index 96d3847..eea3d4a 100644
--- a/xkb/xkbActions.c
+++ b/xkb/xkbActions.c
@@ -41,6 +41,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #include "xkb.h"
 #include <ctype.h>
 #include "mi.h"
+#include "mipointer.h"
 #define EXTENSION_EVENT_BASE 64
 
 DevPrivateKeyRec xkbDevicePrivateKeyRec;
@@ -1337,6 +1338,8 @@ XkbFakePointerMotion(DeviceIntPtr dev, unsigned flags,int x,int y)
     EventListPtr        events;
     int                 nevents, i;
     DeviceIntPtr        ptr;
+    ScreenPtr           pScreen;
+    Bool                saveWait;
     int                 gpe_flags = 0;
 
     if (IsMaster(dev))
@@ -1353,9 +1356,12 @@ XkbFakePointerMotion(DeviceIntPtr dev, unsigned flags,int x,int y)
 
     events = InitEventList(GetMaximumEventsNum());
     OsBlockSignals();
+    pScreen = miPointerGetScreen(ptr);
+    saveWait = miPointerSetWaitForUpdate(pScreen, FALSE);
     nevents = GetPointerEvents(events, ptr,
                                MotionNotify, 0,
                                gpe_flags, 0, 2, (int[]){x, y});
+    miPointerSetWaitForUpdate(pScreen, saveWait);
     OsReleaseSignals();
 
     for (i = 0; i < nevents; i++)
commit 3d9079b898c432a87f9b95c1f39a85f660bf0858
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Thu Jun 3 19:00:53 2010 -0700

    Add API to update setting of waitForUpdate screen private in miPointer
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.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/ramdac/xf86Cursor.c b/hw/xfree86/ramdac/xf86Cursor.c
index e16b510..ec781aa 100644
--- a/hw/xfree86/ramdac/xf86Cursor.c
+++ b/hw/xfree86/ramdac/xf86Cursor.c
@@ -245,8 +245,6 @@ xf86CursorSwitchMode(int index, DisplayModePtr mode, int flags)
     ScreenPtr pScreen = screenInfo.screens[index];
     xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr)dixLookupPrivate(
 	&pScreen->devPrivates, xf86CursorScreenKey);
-    miPointerScreenPtr PointPriv = (miPointerScreenPtr)dixLookupPrivate(
-	&pScreen->devPrivates, miPointerScreenKey);
 
     if (ScreenPriv->isUp) {
 	xf86SetCursor(pScreen, NullCursor, ScreenPriv->x, ScreenPriv->y);
@@ -261,7 +259,7 @@ xf86CursorSwitchMode(int index, DisplayModePtr mode, int flags)
      * ensure the cursor is repainted by miPointerWarpCursor().
      */
     ScreenPriv->CursorToRestore = ScreenPriv->CurrentCursor;
-    PointPriv->waitForUpdate = FALSE;	/* Force cursor repaint */
+    miPointerSetWaitForUpdate(pScreen, FALSE);	/* Force cursor repaint */
 
     return ret;
 }
@@ -302,9 +300,6 @@ xf86CursorSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs,
     xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr)dixLookupPrivate(
 	&pScreen->devPrivates, xf86CursorScreenKey);
     xf86CursorInfoPtr infoPtr = ScreenPriv->CursorInfoPtr;
-    miPointerScreenPtr PointPriv = (miPointerScreenPtr)dixLookupPrivate(
-    &pScreen->devPrivates, miPointerScreenKey);
-
 
     if (pCurs == NullCursor) {	/* means we're supposed to remove the cursor */
         if (ScreenPriv->SWCursor ||
@@ -355,11 +350,12 @@ xf86CursorSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs,
 	    xf86SetCursor(pScreen, pCurs, x, y);
 	    ScreenPriv->SWCursor = FALSE;
 	    ScreenPriv->isUp = TRUE;
-	    PointPriv->waitForUpdate = !infoPtr->pScrn->silkenMouse;
+
+	    miPointerSetWaitForUpdate(pScreen, !infoPtr->pScrn->silkenMouse);
 	    return;
 	}
 
-        PointPriv->waitForUpdate = TRUE;
+        miPointerSetWaitForUpdate(pScreen, TRUE);
 
         if (ScreenPriv->isUp) {
             /* Remove the HW cursor, or make it transparent */
diff --git a/mi/mipointer.c b/mi/mipointer.c
index 33bb40b..9936a01 100644
--- a/mi/mipointer.c
+++ b/mi/mipointer.c
@@ -452,6 +452,22 @@ miPointerGetScreen(DeviceIntPtr pDev)
     return (pPointer) ? pPointer->pScreen : NULL;
 }
 
+/* Controls whether the cursor image should be updated immediately when
+   moved (FALSE) or if something else will be responsible for updating
+   it later (TRUE).  Returns current setting.
+   Caller is responsible for calling OsBlockSignal first.
+*/
+Bool
+miPointerSetWaitForUpdate(ScreenPtr pScreen, Bool wait)
+{
+    SetupScreen(pScreen);
+    Bool prevWait = pScreenPriv->waitForUpdate;
+
+    pScreenPriv->waitForUpdate = wait;
+    return prevWait;
+}
+
+
 /* Move the pointer on the current screen,  and update the sprite. */
 static void
 miPointerMoved (DeviceIntPtr pDev, ScreenPtr pScreen,
diff --git a/mi/mipointer.h b/mi/mipointer.h
index de58c07..3c86110 100644
--- a/mi/mipointer.h
+++ b/mi/mipointer.h
@@ -139,6 +139,11 @@ extern _X_EXPORT void miPointerSetPosition(
 extern _X_EXPORT void miPointerUpdateSprite(
     DeviceIntPtr pDev);
 
+/* Sets whether the sprite should be updated immediately on pointer moves */
+extern _X_EXPORT Bool miPointerSetWaitForUpdate(
+    ScreenPtr pScreen,
+    Bool wait);
+
 extern _X_EXPORT DevPrivateKeyRec miPointerPrivKeyRec;
 #define miPointerPrivKey (&miPointerPrivKeyRec)
 


More information about the xorg-commit mailing list