|
|
|
@ -137,7 +137,7 @@ evdev_flush_pending_event(struct evdev_device *device, uint32_t time) |
|
|
|
|
wl_fixed_from_int(cy), |
|
|
|
|
&x, &y); |
|
|
|
|
|
|
|
|
|
if (device->caps & EVDEV_TOUCH) |
|
|
|
|
if (device->seat_caps & EVDEV_SEAT_TOUCH) |
|
|
|
|
notify_touch(master, time, 0, x, y, WL_TOUCH_MOTION); |
|
|
|
|
else |
|
|
|
|
notify_motion_absolute(master, time, x, y); |
|
|
|
@ -444,7 +444,8 @@ evdev_configure_device(struct evdev_device *device) |
|
|
|
|
unsigned long abs_bits[NBITS(ABS_MAX)]; |
|
|
|
|
unsigned long rel_bits[NBITS(REL_MAX)]; |
|
|
|
|
unsigned long key_bits[NBITS(KEY_MAX)]; |
|
|
|
|
int has_key, has_abs, has_rel, has_mt, has_button, has_keyboard; |
|
|
|
|
int has_key, has_abs, has_rel, has_mt; |
|
|
|
|
int has_button, has_keyboard, has_touch; |
|
|
|
|
unsigned int i; |
|
|
|
|
|
|
|
|
|
has_key = 0; |
|
|
|
@ -453,7 +454,7 @@ evdev_configure_device(struct evdev_device *device) |
|
|
|
|
has_mt = 0; |
|
|
|
|
has_button = 0; |
|
|
|
|
has_keyboard = 0; |
|
|
|
|
device->caps = 0; |
|
|
|
|
has_touch = 0; |
|
|
|
|
|
|
|
|
|
ioctl(device->fd, EVIOCGBIT(0, sizeof(ev_bits)), ev_bits); |
|
|
|
|
if (TEST_BIT(ev_bits, EV_ABS)) { |
|
|
|
@ -495,13 +496,12 @@ evdev_configure_device(struct evdev_device *device) |
|
|
|
|
device->abs.min_y = absinfo.minimum; |
|
|
|
|
device->abs.max_y = absinfo.maximum; |
|
|
|
|
device->is_mt = 1; |
|
|
|
|
device->caps |= EVDEV_TOUCH; |
|
|
|
|
has_touch = 1; |
|
|
|
|
has_mt = 1; |
|
|
|
|
|
|
|
|
|
if (!TEST_BIT(abs_bits, ABS_MT_SLOT)) { |
|
|
|
|
device->mtdev = mtdev_new_open(device->fd); |
|
|
|
|
if (!device->mtdev) { |
|
|
|
|
device->caps = 0; |
|
|
|
|
weston_log("mtdev required but failed to open for %s\n", |
|
|
|
|
device->devnode); |
|
|
|
|
return 0; |
|
|
|
@ -539,13 +539,11 @@ evdev_configure_device(struct evdev_device *device) |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (TEST_BIT(key_bits, BTN_TOUCH)) { |
|
|
|
|
device->caps |= EVDEV_TOUCH; |
|
|
|
|
} |
|
|
|
|
if (TEST_BIT(key_bits, BTN_TOUCH)) |
|
|
|
|
has_touch = 1; |
|
|
|
|
for (i = BTN_MISC; i < BTN_JOYSTICK; i++) { |
|
|
|
|
if (TEST_BIT(key_bits, i)) { |
|
|
|
|
has_button = 1; |
|
|
|
|
device->caps &= ~EVDEV_TOUCH; |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -560,7 +558,6 @@ evdev_configure_device(struct evdev_device *device) |
|
|
|
|
weston_log("input device %s, %s " |
|
|
|
|
"ignored: unsupported device type\n", |
|
|
|
|
device->devname, device->devnode); |
|
|
|
|
device->caps = 0; |
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -580,7 +577,7 @@ evdev_configure_device(struct evdev_device *device) |
|
|
|
|
weston_log("input device %s, %s is a keyboard\n", |
|
|
|
|
device->devname, device->devnode); |
|
|
|
|
} |
|
|
|
|
if ((device->caps & EVDEV_TOUCH)) { |
|
|
|
|
if (has_touch && !has_button) { |
|
|
|
|
weston_seat_init_touch(device->seat); |
|
|
|
|
device->seat_caps |= EVDEV_SEAT_TOUCH; |
|
|
|
|
weston_log("input device %s, %s is a touch device\n", |
|
|
|
|