[PATCH 1/3] dix: ConfineCursorToWindow must clip by siblings

Adam Jackson ajax at redhat.com
Thu Aug 7 13:39:33 PDT 2014


By the protocol spec:

    If a confine-to window is specified, then the pointer will be
    restricted to stay contained in that window.

"Contained" is defined as:

    A window "contains" the pointer if the window is viewable and the
    hotspot of the cursor is within a visible region of the window or a
    visible region of one of its inferiors. The border of the window is
    included as part of the window for containment. The pointer is "in"
    a window if the window contains the pointer but no inferior
    contains the pointer.

The visible region must account for sibling clipping.  borderSize is the
raw geometry of the window, whereas borderClip is borderSize clipped by
siblings.

Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 dix/events.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/dix/events.c b/dix/events.c
index b8c67fd..b06f214 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -894,9 +894,8 @@ ConfineCursorToWindow(DeviceIntPtr pDev, WindowPtr pWin, Bool generateEvents,
             return;
         }
 #endif
-        pSprite->hotLimits = *RegionExtents(&pWin->borderSize);
-        pSprite->hotShape = wBoundingShape(pWin) ? &pWin->borderSize
-            : NullRegion;
+        pSprite->hotLimits = *RegionExtents(&pWin->borderClip);
+        pSprite->hotShape = wBoundingShape(pWin) ? &pWin->borderClip : NULL;
         CheckPhysLimits(pDev, pSprite->current, generateEvents,
                         confineToScreen, pWin->drawable.pScreen);
     }
-- 
1.9.3



More information about the xorg-devel mailing list