From 7d9dece74fc2bf130ceb8818ced5d9e3ac526900 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 21 Jul 2008 22:12:45 +0930 Subject: [PATCH] dix: fix up enter/leave system once again. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- dix/events.c | 13 ++++++++----- 1 file 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. */