summaryrefslogtreecommitdiff
path: root/Xi
diff options
context:
space:
mode:
authorJasper St. Pierre <jstpierre@mecheye.net>2012-11-08 01:17:40 -0500
committerPeter Hutterer <peter.hutterer@who-t.net>2012-12-17 15:02:32 +1000
commit3b2fbcfa6c75ab072926ab9659adf785b324ce28 (patch)
tree9e7375c355b409a61aad5b9e053af3010dcbd92e /Xi
parenta1ee26e624e6a7030ecb37a608190cb8e3d1f65b (diff)
barriers: Add support for edge cases when releasing barriers
If we release a barrier, we want to ensure that we block all other barriers afterwards, rather than capping the limit to the two nearest barriers. Signed-off-by: Jasper St. Pierre <jstpierre@mecheye.net> Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
Diffstat (limited to 'Xi')
-rw-r--r--Xi/xibarriers.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/Xi/xibarriers.c b/Xi/xibarriers.c
index 8f122537a..ac94927bf 100644
--- a/Xi/xibarriers.c
+++ b/Xi/xibarriers.c
@@ -267,6 +267,9 @@ barrier_find_nearest(BarrierScreenPtr cs, DeviceIntPtr dev,
struct PointerBarrier *b = &c->barrier;
double distance;
+ if (c->hit)
+ continue;
+
if (!barrier_is_blocking_direction(b, dir))
continue;
@@ -321,7 +324,6 @@ input_constrain_cursor(DeviceIntPtr dev, ScreenPtr screen,
int x = dest_x,
y = dest_y;
int dir;
- int i;
struct PointerBarrier *nearest = NULL;
PointerBarrierClientPtr c;
Time ms = GetTimeInMillis();
@@ -349,8 +351,7 @@ input_constrain_cursor(DeviceIntPtr dev, ScreenPtr screen,
*/
dir = barrier_get_direction(current_x, current_y, x, y);
-#define MAX_BARRIERS 2
- for (i = 0; i < MAX_BARRIERS; i++) {
+ while (dir != 0) {
c = barrier_find_nearest(cs, dev, dir, current_x, current_y, x, y);
if (!c)
break;