From 56afd60def0c39c30511f2b8e21a25fba0f9e065 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 16 Dec 2008 12:05:54 +1000 Subject: [PATCH] dix: don't set the child window for non-virtual Enter/Leave events. (#19086) According to the X Protocol Spec: "In a LeaveNotify event, if a child of the event window contains the initial position of the pointer, then the child component is set to that child. Otherwise, it is None. For an EnterNotify event, if a child of the event window contains the final pointer position, then the child component is set to that child. Otherwise, it is None." This means we must not set "child" for any event that has detail NotifyInferior, NotifyNonlinear or NotifyAncestor. X.Org Bug 19086 Signed-off-by: Peter Hutterer --- dix/enterleave.c | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dix/enterleave.c b/dix/enterleave.c index abed67b..f759f1b 100644 --- a/dix/enterleave.c +++ b/dix/enterleave.c @@ -85,7 +85,7 @@ * 3. a. if B has another pointer, finish * b. otherwise, if B has a child with a pointer in it, * LeaveNotify(Virtual, child(B)) between child(B) and B. - * EnterNotify(Inferior, child(B)) to B. + * EnterNotify(Inferior) to B. * c. otherwise, EnterNotify(Ancestor) to B. * * -------------------------------------------------------------------------- @@ -93,7 +93,7 @@ * Pointer moves from A to B, A is a child of B (CoreEnterLeaveToAncestor): * 1. a. If A has another pointer, goto 2. * b. Otherwise, if A has a child with a pointer in it. - * LeaveNotify(Inferior, child(A)) to A. + * LeaveNotify(Inferior) to A. * EnterNotify(Virtual, child(A)) between A and child(A). * Skip to 3. * @@ -333,7 +333,7 @@ CoreEnterLeaveNonLinear(DeviceIntPtr dev, /* 1.a */ /* 1.b */ if (!hasPointerA && (childA = FirstPointerChild(A, None))) { - CoreEnterLeaveEvent(dev, LeaveNotify, mode, NotifyInferior, A, WID(childA)); + CoreEnterLeaveEvent(dev, LeaveNotify, mode, NotifyInferior, A, None); EnterNotifies(dev, A, childA, mode, NotifyVirtual, TRUE); } else { /* 3 */ @@ -370,7 +370,7 @@ CoreEnterLeaveNonLinear(DeviceIntPtr dev, if ((childB = FirstPointerChild(B, None))) { LeaveNotifies(dev, childB, B, mode, NotifyVirtual, TRUE); - CoreEnterLeaveEvent(dev, EnterNotify, mode, NotifyInferior, B, WID(childB)); + CoreEnterLeaveEvent(dev, EnterNotify, mode, NotifyInferior, B, None); } else /* 5.c */ CoreEnterLeaveEvent(dev, EnterNotify, mode, NotifyNonlinear, B, None); @@ -392,7 +392,7 @@ CoreEnterLeaveToAncestor(DeviceIntPtr dev, /* 1.a */ /* 1.b */ if (!hasPointerA && (childA = FirstPointerChild(A, None))) { - CoreEnterLeaveEvent(dev, LeaveNotify, mode, NotifyInferior, A, WID(childA)); + CoreEnterLeaveEvent(dev, LeaveNotify, mode, NotifyInferior, A, None); EnterNotifies(dev, A, childA, mode, NotifyVirtual, TRUE); } else { /* 2 */ @@ -424,7 +424,7 @@ CoreEnterLeaveToDescendant(DeviceIntPtr dev, /* 1 */ if (!HasPointer(A)) - CoreEnterLeaveEvent(dev, LeaveNotify, mode, NotifyInferior, A, WID(B)); + CoreEnterLeaveEvent(dev, LeaveNotify, mode, NotifyInferior, A, None); /* 2 */ X = FirstPointerAncestor(B, A); @@ -450,7 +450,7 @@ CoreEnterLeaveToDescendant(DeviceIntPtr dev, if (childB) { LeaveNotifies(dev, childB, B, mode, NotifyVirtual, TRUE); - CoreEnterLeaveEvent(dev, EnterNotify, mode, NotifyInferior, B, WID(childB)); + CoreEnterLeaveEvent(dev, EnterNotify, mode, NotifyInferior, B, None); } else /* 3.c */ CoreEnterLeaveEvent(dev, EnterNotify, mode, NotifyAncestor, B, None); } -- 1.6.0.5