Split weston_seat_init up into pointer/keyboard/touch
authorDaniel Stone <daniel@fooishbar.org>
Wed, 30 May 2012 15:32:02 +0000 (16:32 +0100)
committerJonas Ådahl <jadahl@gmail.com>
Sun, 10 Nov 2013 16:51:29 +0000 (17:51 +0100)
So we don't unnecessarily advertise interfaces the seat doesn't support.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
src/evdev.c

index a9c132c..23faaa6 100644 (file)
@@ -440,6 +440,14 @@ evdev_configure_device(struct evdev_input_device *device)
        if (has_abs && !has_key)
                return -1;
 
+       if ((device->caps &
+            (EVDEV_MOTION_ABS | EVDEV_MOTION_REL | EVDEV_BUTTON)))
+               weston_seat_init_pointer(&device->master->base);
+       if ((device->caps & EVDEV_KEYBOARD))
+               weston_seat_init_keyboard(&device->master->base);
+       if ((device->caps & EVDEV_TOUCH))
+               weston_seat_init_touch(&device->master->base);
+
        return 0;
 }