blob: a6d8871d8fc00b9f6be0dc7b97d01f4c4a099ee8 [file] [log] [blame]
From 5b8cafec54186ffc038874102e53419c2339130b Mon Sep 17 00:00:00 2001
From: Chris Wolfe <cwolfe@chromium.org>
Date: Mon, 23 Jul 2012 15:54:47 -0400
Subject: [PATCH] fixes: Prevent the cursor from leaking at corners
This is a quick fix to prevent the cursor from leaking through between
xfixes boundaries at corners. Previously the barrier_is_blocking_direction
would consider e.g. a +X barrier to block -Y movement, so the second check
in CursorConstrainCursorHarder would repeat the same barrier in some
configurations.
---
xfixes/cursor.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/xfixes/cursor.c b/xfixes/cursor.c
index 7c46269..b9d5c4b 100644
--- a/xfixes/cursor.c
+++ b/xfixes/cursor.c
@@ -1055,7 +1055,15 @@ barrier_is_blocking_direction(const struct PointerBarrier * barrier,
int direction)
{
/* Barriers define which way is ok, not which way is blocking */
- return (barrier->directions & direction) != direction;
+ int blocks;
+ if (barrier_is_vertical(barrier)) {
+ blocks = BarrierNegativeX | BarrierPositiveX;
+ } else {
+ blocks = BarrierNegativeY | BarrierPositiveY;
+ }
+ blocks &= ~barrier->directions;
+
+ return (blocks & direction) != 0;
}
/**
--
1.7.7.3