summaryrefslogtreecommitdiff
path: root/src/libinput-device.c
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2014-11-19 11:04:12 -0600
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>2014-11-27 15:26:04 +0200
commitd621df2dee522d9768a8aff1dd200f3595e29c65 (patch)
treef913c216d0c4e8bd659378997f433e0fe504baa3 /src/libinput-device.c
parent8b5211835fa7dda5ced9f7efbbe0826d8d894d94 (diff)
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>
Diffstat (limited to 'src/libinput-device.c')
-rw-r--r--src/libinput-device.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libinput-device.c b/src/libinput-device.c
index 0e3f46de..8a48905f 100644
--- a/src/libinput-device.c
+++ b/src/libinput-device.c
@@ -470,7 +470,7 @@ evdev_notify_keyboard_focus(struct weston_seat *seat,
{
struct wl_array keys;
- if (!seat->keyboard_device_count > 0)
+ if (seat->keyboard_device_count == 0)
return;
wl_array_init(&keys);