Blame SOURCES/0001-dix-Fix-GrabPointer-to-not-wrongly-succeed-on-redire.patch

0b0bd3
From 19573148ff40b6b4eb335e92cb97ac97ec191450 Mon Sep 17 00:00:00 2001
0b0bd3
From: Adam Jackson <ajax@redhat.com>
0b0bd3
Date: Tue, 12 Aug 2014 13:32:07 -0400
0b0bd3
Subject: [PATCH] dix: Fix GrabPointer to not wrongly succeed on redirected
0b0bd3
 windows
0b0bd3
0b0bd3
Not correct, but correcter.  See upstream discussion for more details,
0b0bd3
hopefully this will get resolved properly in 1.16.
0b0bd3
0b0bd3
Signed-off-by: Adam Jackson <ajax@redhat.com>
0b0bd3
---
0b0bd3
 dix/events.c | 33 ++++++++++++++++++++++++++++++---
0b0bd3
 1 file changed, 30 insertions(+), 3 deletions(-)
0b0bd3
0b0bd3
diff --git a/dix/events.c b/dix/events.c
0b0bd3
index b8c67fd..9300a3c 100644
0b0bd3
--- a/dix/events.c
0b0bd3
+++ b/dix/events.c
0b0bd3
@@ -3616,10 +3616,38 @@ ProcWarpPointer(ClientPtr client)
0b0bd3
     return Success;
0b0bd3
 }
0b0bd3
 
0b0bd3
+/*
0b0bd3
+ * this is better but still wrong.  upstream discussion:
0b0bd3
+ * http://lists.freedesktop.org/archives/xorg-devel/2014-July/043374.html
0b0bd3
+ *
0b0bd3
+ * in the meantime all we're doing is amending the redirected window path
0b0bd3
+ * to check whether borderClip (total window area) overlaps the root window
0b0bd3
+ * space at all.
0b0bd3
+ *
0b0bd3
+ * note that the redirect path doesn't need to account for panoramix'
0b0bd3
+ * rewrite of root window geometry, because root windows can't be
0b0bd3
+ * redirected.
0b0bd3
+ */
0b0bd3
+static Bool
0b0bd3
+WindowIsConfineToAble(WindowPtr pWin)
0b0bd3
+{
0b0bd3
+    if (pWin->redirectDraw == RedirectDrawNone) {
0b0bd3
+        if (RegionNotEmpty(&pWin->borderSize))
0b0bd3
+            return TRUE;
0b0bd3
+    } else {
0b0bd3
+        WindowPtr root = pWin->drawable.pScreen->root;
0b0bd3
+        if (rgnOUT != RegionContainsRect(&pWin->borderClip,
0b0bd3
+                                         RegionExtents(&root->winSize)))
0b0bd3
+            return TRUE;
0b0bd3
+    }
0b0bd3
+
0b0bd3
+    return FALSE;
0b0bd3
+}
0b0bd3
+
0b0bd3
 static Bool
0b0bd3
 BorderSizeNotEmpty(DeviceIntPtr pDev, WindowPtr pWin)
0b0bd3
 {
0b0bd3
-    if (RegionNotEmpty(&pWin->borderSize))
0b0bd3
+    if (WindowIsConfineToAble(pWin))
0b0bd3
         return TRUE;
0b0bd3
 
0b0bd3
 #ifdef PANORAMIX
0b0bd3
@@ -3627,8 +3655,7 @@ BorderSizeNotEmpty(DeviceIntPtr pDev, WindowPtr pWin)
0b0bd3
         int i;
0b0bd3
 
0b0bd3
         FOR_NSCREENS_FORWARD_SKIP(i) {
0b0bd3
-            if (RegionNotEmpty
0b0bd3
-                (&pDev->spriteInfo->sprite->windows[i]->borderSize))
0b0bd3
+            if (WindowIsConfineToAble(pDev->spriteInfo->sprite->windows[i]))
0b0bd3
                 return TRUE;
0b0bd3
         }
0b0bd3
     }
0b0bd3
-- 
0b0bd3
1.9.3
0b0bd3