summaryrefslogtreecommitdiff
path: root/dix
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2008-07-21 22:12:45 +0930
committerPeter Hutterer <peter.hutterer@who-t.net>2008-07-28 09:04:41 +0930
commit7d9dece74fc2bf130ceb8818ced5d9e3ac526900 (patch)
treea257ae25b955dc1015ea9520d8f8cc095c5b772e /dix
parent2ce434f54bc0d6050ef115e310df62c035e84bf2 (diff)
dix: fix up enter/leave system once again.
Two corrections 1. the "detail" field has NotifyVirtual, etc., not the "mode" field. This was a clear bug. 2. don't set/unset the flags for NotifyGrab or NotifyUngrab. Clients are expected to deal with multiple enter/leave events per window if the mode is not NotifyNormal. Testable with TCL menu boxes (such as used in gitk): tk_optionMenu .menu globVar Val1 Val2 Val3 ValJunk pack .menu Thanks to Michel Dänzer for pointing this out.
Diffstat (limited to 'dix')
-rw-r--r--dix/events.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/dix/events.c b/dix/events.c
index c5578b097..d6b3ecb1f 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -4441,14 +4441,16 @@ EnterLeaveEvent(
/* Clear bit for device, but don't worry about SDs. */
if (mouse->isMaster && type == LeaveNotify &&
- (mode != NotifyVirtual && mode != NotifyNonlinearVirtual))
- ENTER_LEAVE_SEMAPHORE_UNSET(pWin, mouse);
+ (detail != NotifyVirtual && detail != NotifyNonlinearVirtual))
+ if (mode != NotifyUngrab)
+ ENTER_LEAVE_SEMAPHORE_UNSET(pWin, mouse);
inWindow = EnterLeaveSemaphoresIsset(pWin);
- if (!inWindow)
+ if(!inWindow || mode == NotifyGrab || mode == NotifyUngrab)
sendevent = TRUE;
+
if ((mask & filters[mouse->id][type]) && sendevent)
{
if (grab)
@@ -4460,8 +4462,9 @@ EnterLeaveEvent(
}
if (mouse->isMaster && type == EnterNotify &&
- (mode != NotifyVirtual && mode != NotifyNonlinearVirtual))
- ENTER_LEAVE_SEMAPHORE_SET(pWin, mouse);
+ (detail != NotifyVirtual && detail != NotifyNonlinearVirtual))
+ if (mode != NotifyGrab)
+ ENTER_LEAVE_SEMAPHORE_SET(pWin, mouse);
/* we don't have enough bytes, so we squash flags and mode into
one byte, and use the last byte for the deviceid. */