evdev: Reset accumulate values when we flush motion events

Otherwise we end up reporting all motion events twice.
This commit is contained in:
Kristian Høgsberg 2011-11-18 10:42:34 -05:00
parent e412ff3025
commit 8b568806aa
2 changed files with 7 additions and 2 deletions

View File

@ -229,9 +229,14 @@ evdev_input_device_data(int fd, uint32_t mask, void *data)
/* we try to minimize the amount of notifications to be
* forwarded to the compositor, so we accumulate motion
* events and send as a bunch */
if (!is_motion_event(e))
if (!is_motion_event(e)) {
evdev_flush_motion(&device->master->base.input_device,
time, x, y, dx, dy, absolute_event);
dx = 0;
dy = 0;
absolute_event = 0;
}
switch (e->type) {
case EV_REL:
evdev_process_relative_motion(e, &dx, &dy);

View File

@ -103,7 +103,7 @@ tty_create(struct wlsc_compositor *compositor, tty_vt_func_t vt_func,
if (tty == NULL)
return NULL;
snprintf(filename, sizeof filename, "/dev/tty%d", tty_nr);
snprintf(filename, sizeof filename, "/dev/tty0");
fprintf(stderr, "compositor: using %s\n", filename);
memset(tty, 0, sizeof *tty);