When we're suspending a touchpad, several events triggered by timers may still be waiting in the background. We still need to release all buttons/keys immediately though so we get an uneven number of release events: one from release_pressed_keys() and one when the timers expire and send the release event through the normal channels.
Don't assert if we're already on a press-count of 0, simply ignore it and discard the event. Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net> --- I'm not 100% sure on this one. It's the easy solution, but until we know the general direction I didn't want to implement the full solution. What's needed here are hooks for suspending/resuming in the dispatch structs so that the touchpad code can cancel anything currently happening and reset the state. For the normal fallback_dispatch the hooks can just release keys and touches. src/evdev.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/evdev.c b/src/evdev.c index 6bbea92..755e7a1 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -74,8 +74,10 @@ update_key_down_count(struct evdev_device *device, int code, int pressed) if (pressed) { key_count = ++device->key_count[code]; } else { - assert(device->key_count[code] > 0); - key_count = --device->key_count[code]; + if (device->key_count[code] > 0) + key_count = --device->key_count[code]; + else + return -1; } if (key_count > 32) { -- 1.9.3 _______________________________________________ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel