[PATCH 2/3] dix: BorderSizeNotEmpty → BorderClipNotEmpty

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


This is used to compute whether the confine-to window for a grab is
legal.  The spec's language says a "confine-to window [that] lies
completely outside the boundaries of the root window" should BadMatch.
Consensus seems to be that this is broken, since it would technically
allow you to confine to a window that is inside the root window
boundaries but not within the boundaries of its parent (ie, viewable but
not visible).  Change it to inspect borderClip instead, which accounts
for clipping by ancestors and siblings.

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

diff --git a/dix/events.c b/dix/events.c
index b06f214..d05b3b5 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -3616,9 +3616,9 @@ ProcWarpPointer(ClientPtr client)
 }
 
 static Bool
-BorderSizeNotEmpty(DeviceIntPtr pDev, WindowPtr pWin)
+BorderClipNotEmpty(DeviceIntPtr pDev, WindowPtr pWin)
 {
-    if (RegionNotEmpty(&pWin->borderSize))
+    if (RegionNotEmpty(&pWin->borderClip))
         return TRUE;
 
 #ifdef PANORAMIX
@@ -3627,7 +3627,7 @@ BorderSizeNotEmpty(DeviceIntPtr pDev, WindowPtr pWin)
 
         FOR_NSCREENS_FORWARD_SKIP(i) {
             if (RegionNotEmpty
-                (&pDev->spriteInfo->sprite->windows[i]->borderSize))
+                (&pDev->spriteInfo->sprite->windows[i]->borderClip))
                 return TRUE;
         }
     }
@@ -3866,7 +3866,7 @@ CheckPassiveGrab(DeviceIntPtr device, GrabPtr grab, InternalEvent *event,
 
     if (!match || (grab->confineTo &&
                    (!grab->confineTo->realized ||
-                    !BorderSizeNotEmpty(device, grab->confineTo))))
+                    !BorderClipNotEmpty(device, grab->confineTo))))
         return FALSE;
 
     /* In some cases a passive core grab may exist, but the client
@@ -5080,7 +5080,7 @@ GrabDevice(ClientPtr client, DeviceIntPtr dev,
         *status = AlreadyGrabbed;
     else if ((!pWin->realized) ||
              (confineTo &&
-              !(confineTo->realized && BorderSizeNotEmpty(dev, confineTo))))
+              !(confineTo->realized && BorderClipNotEmpty(dev, confineTo))))
         *status = GrabNotViewable;
     else if ((CompareTimeStamps(time, currentTime) == LATER) ||
              (CompareTimeStamps(time, grabInfo->grabTime) == EARLIER))
@@ -5801,7 +5801,7 @@ CheckCursorConfinement(WindowPtr pWin)
         if (DevHasCursor(pDev)) {
             grab = pDev->deviceGrab.grab;
             if (grab && (confineTo = grab->confineTo)) {
-                if (!BorderSizeNotEmpty(pDev, confineTo))
+                if (!BorderClipNotEmpty(pDev, confineTo))
                     (*pDev->deviceGrab.DeactivateGrab) (pDev);
                 else if ((pWin == confineTo) || IsParent(pWin, confineTo))
                     ConfineCursorToWindow(pDev, confineTo, TRUE, TRUE);
-- 
1.9.3



More information about the xorg-devel mailing list