evdev: Fix assertion error for unplugged output with paired touchscreen
authorAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Thu, 24 Apr 2014 12:11:16 +0000 (15:11 +0300)
committerKristian Høgsberg <krh@bitplanet.net>
Fri, 25 Apr 2014 22:03:46 +0000 (15:03 -0700)
commitae826cead7caa46e03984955d38631ad0ea0c8fd
tree629da4fa29a2a047f06f4fc552683c15466e7b17
parent6c975faaa9310c7b9f0e723540ec64d3c2343c87
evdev: Fix assertion error for unplugged output with paired touchscreen

If the output a touchscreen is paired to is unplugged, events coming
from it should be ignored. Commit 17bccaed introduced logic for that
in evdev_flush_pending_damage(). However, the break statements it
introduced would cause the assertion after the switch statement to
fail.

That function has the odd behavior that goto's are used to skip the
assertion after the switch statement and jump to the hunk of code that
marks the event as processed. Only in the case where the event type has
an invalid value the assertion should trigger. So this patch fixes the
problem by moving the assertion into the default case of the switch
and replacing the goto statements with break ones.

https://bugs.freedesktop.org/show_bug.cgi?id=73950
src/evdev.c