summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2011-11-18 10:42:34 -0500
committerKristian Høgsberg <krh@bitplanet.net>2011-11-18 10:42:34 -0500
commit8b568806aa0576d6d6aa3ce4e90b2f04a4a1f32a (patch)
treeaddb49e05b4a8f21919b4de47e7b0950aea031ef
parente412ff302542bc8c73ba1cc6bcc845980e4e2f10 (diff)
evdev: Reset accumulate values when we flush motion events
Otherwise we end up reporting all motion events twice.
-rw-r--r--compositor/evdev.c7
-rw-r--r--compositor/tty.c2
2 files changed, 7 insertions, 2 deletions
diff --git a/compositor/evdev.c b/compositor/evdev.c
index 784fa4c..5138c09 100644
--- a/compositor/evdev.c
+++ b/compositor/evdev.c
@@ -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);
diff --git a/compositor/tty.c b/compositor/tty.c
index 5ed921c..4989500 100644
--- a/compositor/tty.c
+++ b/compositor/tty.c
@@ -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);