dix: if grab types differ, two grabs cannot be the same.

This commit is contained in:
Peter Hutterer 2009-05-04 15:58:15 +10:00
parent 63a3c727b3
commit 834ea071b6
2 changed files with 14 additions and 3 deletions

View File

@ -3323,13 +3323,17 @@ CheckPassiveGrabsOnWindow(
/* Check for XI grabs first */
tempGrab.type = GetXIType((InternalEvent*)event);
tempGrab.grabtype = GRABTYPE_XI;
if (GrabMatchesSecond(&tempGrab, grab, FALSE))
match = XI_MATCH;
/* Check for a core grab (ignore the device when comparing) */
if (!match && checkCore &&
(tempGrab.type = GetCoreType((InternalEvent*)event)) &&
(GrabMatchesSecond(&tempGrab, grab, TRUE)))
if (!match && checkCore)
{
tempGrab.grabtype = GRABTYPE_CORE;
if ((tempGrab.type = GetCoreType((InternalEvent*)event)) &&
(GrabMatchesSecond(&tempGrab, grab, TRUE)))
match = CORE_MATCH;
}
if (match && (!grab->confineTo ||
(grab->confineTo->realized &&

View File

@ -254,6 +254,10 @@ GrabSupersedesSecond(GrabPtr pFirstGrab, GrabPtr pSecondGrab)
Bool
GrabMatchesSecond(GrabPtr pFirstGrab, GrabPtr pSecondGrab, Bool ignoreDevice)
{
if (pFirstGrab->grabtype != pSecondGrab->grabtype)
return FALSE;
if (!ignoreDevice &&
((pFirstGrab->device != pSecondGrab->device) ||
(pFirstGrab->modifierDevice != pSecondGrab->modifierDevice)))
@ -288,6 +292,9 @@ GrabMatchesSecond(GrabPtr pFirstGrab, GrabPtr pSecondGrab, Bool ignoreDevice)
static Bool
GrabsAreIdentical(GrabPtr pFirstGrab, GrabPtr pSecondGrab)
{
if (pFirstGrab->grabtype != pSecondGrab->grabtype)
return FALSE;
if (pFirstGrab->device != pSecondGrab->device ||
(pFirstGrab->modifierDevice != pSecondGrab->modifierDevice) ||
(pFirstGrab->type != pSecondGrab->type))