Input: Simplify CheckPassiveGrabsOnWindow loop

Instead of a mega never-ending if branch with no else, just continue
to the next iteration of the loop if the conditions aren't met - pretty
much entirely reindentation.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Daniel Stone 2011-01-19 20:42:10 +00:00 committed by Peter Hutterer
parent 00ba884556
commit 70cef8d8ba

View File

@ -3430,7 +3430,7 @@ CheckPassiveGrabsOnWindow(
DeviceIntPtr gdev;
XkbSrvInfoPtr xkbi = NULL;
xEvent *xE = NULL;
xEvent core;
int count, rc;
gdev= grab->modifierDevice;
if (grab->grabtype == GRABTYPE_CORE)
@ -3478,12 +3478,10 @@ CheckPassiveGrabsOnWindow(
match = CORE_MATCH;
}
if (match && (!grab->confineTo ||
(grab->confineTo->realized &&
BorderSizeNotEmpty(device, grab->confineTo))))
{
int rc, count = 0;
xEvent *xE = NULL;
if (!match || (grab->confineTo &&
(!grab->confineTo->realized ||
!BorderSizeNotEmpty(device, grab->confineTo))))
continue;
grabinfo = &device->deviceGrab;
/* In some cases a passive core grab may exist, but the client
@ -3534,29 +3532,28 @@ CheckPassiveGrabsOnWindow(
}
else if (!GetXIType(event) && !GetCoreType(event))
{
ErrorF("Event type %d in CheckPassiveGrabsOnWindow is"
" neither XI 1.x nor core\n", event->any.type);
ErrorF("Event type %d in CheckPassiveGrabsOnWindow is neither"
" XI 1.x nor core\n", event->any.type);
return NULL;
}
/* The only consumers of corestate are Xi 1.x and core events,
* which are guaranteed to come from DeviceEvents. */
/* The only consumers of corestate are Xi 1.x and core events, which
* are guaranteed to come from DeviceEvents. */
if (match & (XI_MATCH | CORE_MATCH))
{
event->device_event.corestate &= 0x1f00;
event->device_event.corestate |=
tempGrab.modifiersDetail.exact & (~0x1f00);
event->device_event.corestate |= tempGrab.modifiersDetail.exact &
(~0x1f00);
}
if (match & CORE_MATCH)
{
rc = EventToCore((InternalEvent*)event, &xE, &count);
rc = EventToCore(event, &xE, &count);
if (rc != Success)
{
if (rc != BadMatch)
ErrorF("[dix] %s: core conversion failed in CPGFW "
"(%d, %d).\n", device->name, event->any.type,
rc);
"(%d, %d).\n", device->name, event->any.type, rc);
continue;
}
} else if (match & XI2_MATCH)
@ -3566,8 +3563,7 @@ CheckPassiveGrabsOnWindow(
{
if (rc != BadMatch)
ErrorF("[dix] %s: XI2 conversion failed in CPGFW "
"(%d, %d).\n", device->name, event->any.type,
rc);
"(%d, %d).\n", device->name, event->any.type, rc);
continue;
}
count = 1;
@ -3578,8 +3574,7 @@ CheckPassiveGrabsOnWindow(
{
if (rc != BadMatch)
ErrorF("[dix] %s: XI conversion failed in CPGFW "
"(%d, %d).\n", device->name, event->any.type,
rc);
"(%d, %d).\n", device->name, event->any.type, rc);
continue;
}
}
@ -3607,7 +3602,6 @@ CheckPassiveGrabsOnWindow(
free(xE);
return grab;
}
}
return NULL;
#undef CORE_MATCH
#undef XI_MATCH