input: Use slightly less obscure logic in evdev_notify_keyboard_focus()
authorDerek Foreman <derekf@osg.samsung.com>
Wed, 19 Nov 2014 17:04:12 +0000 (11:04 -0600)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Thu, 27 Nov 2014 13:26:04 +0000 (15:26 +0200)
commitd621df2dee522d9768a8aff1dd200f3595e29c65
treef913c216d0c4e8bd659378997f433e0fe504baa3
parent8b5211835fa7dda5ced9f7efbbe0826d8d894d94
input: Use slightly less obscure logic in evdev_notify_keyboard_focus()

While the test is actually correct (for non-negative numbers), it's not
at all clear and seems to be an accidental order of operations mistake.

Also, add an assert() to make sure this number is never negative.

Closes bug 86346 - https://bugs.freedesktop.org/show_bug.cgi?id=86346

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Marek Chalupa <mchqwerty@gmail.com>
src/input.c
src/libinput-device.c