Skip to content

Commit

Permalink
dix: clear up an overly convoluted if statement.
Browse files Browse the repository at this point in the history
No functional changes, just improves readability. This statement had things
added to/removed from it for a few server releases while the input event
queue was revamped. What made sense once is now mainly confusing.

Signed-off-by: Peter Hutterer <[email protected]>
Reviewed-by: Chase Douglas <[email protected]>
  • Loading branch information
whot committed Dec 9, 2010
1 parent 2c70b65 commit aba8133
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions dix/getevents.c
Original file line number Diff line number Diff line change
Expand Up @@ -1104,17 +1104,25 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons,
if (!pDev->enabled)
return 0;

ms = GetTimeInMillis(); /* before pointer update to help precision */

if (!scr || !pDev->valuator ||
(type != MotionNotify && type != ButtonPress && type != ButtonRelease) ||
(type != MotionNotify && !pDev->button) ||
((type == ButtonPress || type == ButtonRelease) && !buttons))
if (!scr || !pDev->valuator)
return 0;

if (type == MotionNotify &&
(!mask_in || valuator_mask_num_valuators(mask_in) <= 0))
return 0;
switch (type)
{
case MotionNotify:
if (!mask_in || valuator_mask_num_valuators(mask_in) <= 0)
return 0;
break;
case ButtonPress:
case ButtonRelease:
if (!pDev->button || !buttons)
return 0;
break;
default:
return 0;
}

ms = GetTimeInMillis(); /* before pointer update to help precision */

events = UpdateFromMaster(events, pDev, DEVCHANGE_POINTER_EVENT, &num_events);

Expand Down

0 comments on commit aba8133

Please sign in to comment.