xserver: Branch 'master' - 2 commits

Adam Jackson ajax at kemper.freedesktop.org
Wed May 25 15:06:17 UTC 2016


 hw/xwayland/xwayland-input.c |    9 +--------
 mi/mipointer.c               |   27 +++++++++++++++++++++++++++
 mi/mipointer.h               |    6 ++++++
 mi/mipointrst.h              |   12 ------------
 4 files changed, 34 insertions(+), 20 deletions(-)

New commits:
commit 4d649d51770cace4d7c1e51d9a199ac7a056c30a
Author: Keith Packard <keithp at keithp.com>
Date:   Wed May 18 16:03:48 2016 -0500

    mi: Remove miPointerRec from API
    
    This moves the definition of miPointerRec from mipointrst.h to
    mipointer.c so that it is no longer visible in the API, allowing it to
    be changed while the API/ABI is frozen.
    
    Reviewed-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/mi/mipointer.c b/mi/mipointer.c
index 7f95cdb..caa7a9f 100644
--- a/mi/mipointer.c
+++ b/mi/mipointer.c
@@ -65,6 +65,18 @@ in this Software without prior written authorization from The Open Group.
 #include   "inpututils.h"
 #include   "eventstr.h"
 
+typedef struct {
+    ScreenPtr pScreen;          /* current screen */
+    ScreenPtr pSpriteScreen;    /* screen containing current sprite */
+    CursorPtr pCursor;          /* current cursor */
+    CursorPtr pSpriteCursor;    /* cursor on screen */
+    BoxRec limits;              /* current constraints */
+    Bool confined;              /* pointer can't change screens */
+    int x, y;                   /* hot spot location */
+    int devx, devy;             /* sprite position */
+    Bool generateEvent;         /* generate an event during warping? */
+} miPointerRec, *miPointerPtr;
+
 DevPrivateKeyRec miPointerScreenKeyRec;
 
 #define GetScreenPrivate(s) ((miPointerScreenPtr) \
diff --git a/mi/mipointrst.h b/mi/mipointrst.h
index 104e45c..4319b12 100644
--- a/mi/mipointrst.h
+++ b/mi/mipointrst.h
@@ -35,18 +35,6 @@ in this Software without prior written authorization from The Open Group.
 #include "scrnintstr.h"
 
 typedef struct {
-    ScreenPtr pScreen;          /* current screen */
-    ScreenPtr pSpriteScreen;    /* screen containing current sprite */
-    CursorPtr pCursor;          /* current cursor */
-    CursorPtr pSpriteCursor;    /* cursor on screen */
-    BoxRec limits;              /* current constraints */
-    Bool confined;              /* pointer can't change screens */
-    int x, y;                   /* hot spot location */
-    int devx, devy;             /* sprite position */
-    Bool generateEvent;         /* generate an event during warping? */
-} miPointerRec, *miPointerPtr;
-
-typedef struct {
     miPointerSpriteFuncPtr spriteFuncs; /* sprite-specific methods */
     miPointerScreenFuncPtr screenFuncs; /* screen-specific methods */
     CloseScreenProcPtr CloseScreen;
commit 3f9015b6dc9e7e9c97f8717dea6af9f4d8523f2e
Author: Keith Packard <keithp at keithp.com>
Date:   Wed May 18 16:03:47 2016 -0500

    xwayland: Move sprite invalidation logic into mipointer
    
    This creates a function that invalidates the current sprite and forces
    a sprite image reload the next time the sprite is checked, moving that
    logic out of the xwayland sources and allowing the miPointerRec
    structure to be removed from the server API.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>
    Reviewed-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>

diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
index cbc1bf2..d186681 100644
--- a/hw/xwayland/xwayland-input.c
+++ b/hw/xwayland/xwayland-input.c
@@ -219,7 +219,6 @@ pointer_handle_enter(void *data, struct wl_pointer *pointer,
     struct xwl_seat *xwl_seat = data;
     DeviceIntPtr dev = xwl_seat->pointer;
     DeviceIntPtr master;
-    miPointerPtr mipointer;
     int i;
     int sx = wl_fixed_to_int(sx_w);
     int sy = wl_fixed_to_int(sy_w);
@@ -243,13 +242,7 @@ pointer_handle_enter(void *data, struct wl_pointer *pointer,
     master = GetMaster(dev, POINTER_OR_FLOAT);
     (*pScreen->SetCursorPosition) (dev, pScreen, sx, sy, TRUE);
 
-    /* X is very likely to have the wrong idea of what the actual cursor
-     * sprite is, so in order to force updating the cursor lets set the
-     * current sprite to some invalid cursor behind its back so that it
-     * always will think it changed to the not invalid cursor.
-     */
-    mipointer = MIPOINTER(master);
-    mipointer->pSpriteCursor = (CursorPtr) 1;
+    miPointerInvalidateSprite(master);
 
     CheckMotion(NULL, master);
 
diff --git a/mi/mipointer.c b/mi/mipointer.c
index ada1ab5..7f95cdb 100644
--- a/mi/mipointer.c
+++ b/mi/mipointer.c
@@ -468,6 +468,21 @@ miPointerUpdateSprite(DeviceIntPtr pDev)
 }
 
 /**
+ * Invalidate the current sprite and force it to be reloaded on next cursor setting
+ * operation
+ *
+ * @param pDev The device to invalidate the sprite fore
+ */
+void
+miPointerInvalidateSprite(DeviceIntPtr pDev)
+{
+    miPointerPtr pPointer;
+
+    pPointer = MIPOINTER(pDev);
+    pPointer->pSpriteCursor = (CursorPtr) 1;
+}
+
+/**
  * Set the device to the coordinates on the given screen.
  *
  * @param pDev The device to move
diff --git a/mi/mipointer.h b/mi/mipointer.h
index bdeed12..7ce6409 100644
--- a/mi/mipointer.h
+++ b/mi/mipointer.h
@@ -109,6 +109,12 @@ miPointerSetPosition(DeviceIntPtr pDev, int mode, double *x, double *y,
 extern _X_EXPORT void
 miPointerUpdateSprite(DeviceIntPtr pDev);
 
+/* Invalidate current sprite, forcing reload on next
+ * sprite setting (window crossing, grab action, etc)
+ */
+extern _X_EXPORT void
+miPointerInvalidateSprite(DeviceIntPtr pDev);
+
 /* Sets whether the sprite should be updated immediately on pointer moves */
 extern _X_EXPORT Bool
 miPointerSetWaitForUpdate(ScreenPtr pScreen, Bool wait);


More information about the xorg-commit mailing list