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:
parent
2ce434f54b
commit
7d9dece74f
13
dix/events.c
13
dix/events.c
|
@ -4441,14 +4441,16 @@ EnterLeaveEvent(
|
||||||
|
|
||||||
/* Clear bit for device, but don't worry about SDs. */
|
/* Clear bit for device, but don't worry about SDs. */
|
||||||
if (mouse->isMaster && type == LeaveNotify &&
|
if (mouse->isMaster && type == LeaveNotify &&
|
||||||
(mode != NotifyVirtual && mode != NotifyNonlinearVirtual))
|
(detail != NotifyVirtual && detail != NotifyNonlinearVirtual))
|
||||||
ENTER_LEAVE_SEMAPHORE_UNSET(pWin, mouse);
|
if (mode != NotifyUngrab)
|
||||||
|
ENTER_LEAVE_SEMAPHORE_UNSET(pWin, mouse);
|
||||||
|
|
||||||
inWindow = EnterLeaveSemaphoresIsset(pWin);
|
inWindow = EnterLeaveSemaphoresIsset(pWin);
|
||||||
|
|
||||||
if (!inWindow)
|
if(!inWindow || mode == NotifyGrab || mode == NotifyUngrab)
|
||||||
sendevent = TRUE;
|
sendevent = TRUE;
|
||||||
|
|
||||||
|
|
||||||
if ((mask & filters[mouse->id][type]) && sendevent)
|
if ((mask & filters[mouse->id][type]) && sendevent)
|
||||||
{
|
{
|
||||||
if (grab)
|
if (grab)
|
||||||
|
@ -4460,8 +4462,9 @@ EnterLeaveEvent(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mouse->isMaster && type == EnterNotify &&
|
if (mouse->isMaster && type == EnterNotify &&
|
||||||
(mode != NotifyVirtual && mode != NotifyNonlinearVirtual))
|
(detail != NotifyVirtual && detail != NotifyNonlinearVirtual))
|
||||||
ENTER_LEAVE_SEMAPHORE_SET(pWin, mouse);
|
if (mode != NotifyGrab)
|
||||||
|
ENTER_LEAVE_SEMAPHORE_SET(pWin, mouse);
|
||||||
|
|
||||||
/* we don't have enough bytes, so we squash flags and mode into
|
/* we don't have enough bytes, so we squash flags and mode into
|
||||||
one byte, and use the last byte for the deviceid. */
|
one byte, and use the last byte for the deviceid. */
|
||||||
|
|
Loading…
Reference in New Issue