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.
This commit is contained in:
Peter Hutterer 2008-07-21 22:12:45 +09:30
parent 2ce434f54b
commit 7d9dece74f

View File

@ -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. */