xserver: Branch 'master' - 2 commits

Keith Packard keithp at kemper.freedesktop.org
Mon Sep 19 15:59:08 UTC 2016


 dix/events.c         |    8 ++++++++
 include/scrnintstr.h |   14 ++++++++++++++
 2 files changed, 22 insertions(+)

New commits:
commit 5998da7855750dd947288349a0b14e65db1e3c8c
Author: Jonas Ådahl <jadahl at gmail.com>
Date:   Tue Sep 13 15:16:56 2016 +0800

    dix: Incroduce CursorConfinedTo vfunc in Screen
    
    This function will be called when a pointer is grabbed non-root window
    set as the 'confineTo'. This will enable the ddx to handle the
    confinement their own way.
    
    Signed-off-by: Jonas Ådahl <jadahl at gmail.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/dix/events.c b/dix/events.c
index 87f080e..cc26ba5 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -882,6 +882,8 @@ ConfineCursorToWindow(DeviceIntPtr pDev, WindowPtr pWin, Bool generateEvents,
         SyntheticMotion(pDev, pSprite->hot.x, pSprite->hot.y);
     }
     else {
+        ScreenPtr pScreen = pWin->drawable.pScreen;
+
 #ifdef PANORAMIX
         if (!noPanoramiXExtension) {
             XineramaConfineCursorToWindow(pDev, pWin, generateEvents);
@@ -893,6 +895,9 @@ ConfineCursorToWindow(DeviceIntPtr pDev, WindowPtr pWin, Bool generateEvents,
             : NullRegion;
         CheckPhysLimits(pDev, pSprite->current, generateEvents,
                         confineToScreen, pWin->drawable.pScreen);
+
+        if (*pScreen->CursorConfinedTo)
+            (*pScreen->CursorConfinedTo) (pDev, pScreen, pWin);
     }
 }
 
diff --git a/include/scrnintstr.h b/include/scrnintstr.h
index faf9f8d..f898392 100644
--- a/include/scrnintstr.h
+++ b/include/scrnintstr.h
@@ -241,6 +241,10 @@ typedef void (*CursorWarpedToProcPtr) (DeviceIntPtr /* pDev */ ,
                                        int /*x */ ,
                                        int /*y */ );
 
+typedef void (*CurserConfinedToProcPtr) (DeviceIntPtr /* pDev */ ,
+                                         ScreenPtr /*pScreen */ ,
+                                         WindowPtr /*pWindow */ );
+
 typedef Bool (*CreateGCProcPtr) (GCPtr /*pGC */ );
 
 typedef Bool (*CreateColormapProcPtr) (ColormapPtr /*pColormap */ );
@@ -563,6 +567,7 @@ typedef struct _Screen {
     RecolorCursorProcPtr RecolorCursor;
     SetCursorPositionProcPtr SetCursorPosition;
     CursorWarpedToProcPtr CursorWarpedTo;
+    CurserConfinedToProcPtr CursorConfinedTo;
 
     /* GC procedures */
 
commit daf48a3aba7d5c42d7156f0d0e2b1d8aae423303
Author: Jonas Ådahl <jadahl at gmail.com>
Date:   Tue Sep 13 15:16:55 2016 +0800

    dix: Introduce CursorWarpedTo vfunc in Screen
    
    This new vfunc will be called, if set, after a client has issued a
    WarpPointer request. This is necessary for implementing pointer warp
    emulation in Xwayland.
    
    Signed-off-by: Jonas Ådahl <jadahl at gmail.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/dix/events.c b/dix/events.c
index 6610b91..87f080e 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -3609,6 +3609,9 @@ ProcWarpPointer(ClientPtr client)
     else if (!PointerConfinedToScreen(dev)) {
         NewCurrentScreen(dev, newScreen, x, y);
     }
+    if (*newScreen->CursorWarpedTo)
+        (*newScreen->CursorWarpedTo) (dev, newScreen, client,
+                                      dest, pSprite, x, y);
     return Success;
 }
 
diff --git a/include/scrnintstr.h b/include/scrnintstr.h
index 52e8382..faf9f8d 100644
--- a/include/scrnintstr.h
+++ b/include/scrnintstr.h
@@ -233,6 +233,14 @@ typedef Bool (*SetCursorPositionProcPtr) (DeviceIntPtr /* pDev */ ,
                                           int /*y */ ,
                                           Bool /*generateEvent */ );
 
+typedef void (*CursorWarpedToProcPtr) (DeviceIntPtr /* pDev */ ,
+                                       ScreenPtr /*pScreen */ ,
+                                       ClientPtr /*pClient */ ,
+                                       WindowPtr /*pWindow */ ,
+                                       SpritePtr /*pSprite */ ,
+                                       int /*x */ ,
+                                       int /*y */ );
+
 typedef Bool (*CreateGCProcPtr) (GCPtr /*pGC */ );
 
 typedef Bool (*CreateColormapProcPtr) (ColormapPtr /*pColormap */ );
@@ -554,6 +562,7 @@ typedef struct _Screen {
     UnrealizeCursorProcPtr UnrealizeCursor;
     RecolorCursorProcPtr RecolorCursor;
     SetCursorPositionProcPtr SetCursorPosition;
+    CursorWarpedToProcPtr CursorWarpedTo;
 
     /* GC procedures */
 


More information about the xorg-commit mailing list