[PATCH weston 3/4] evdev: Fix assertion error for unplugged output with paired touchscreen

Neil Roberts neil at linux.intel.com
Thu Apr 24 08:34:31 PDT 2014


I think I wrote the goto handled code. The advantage of that over
putting the assert in the default handler is that if a new event type is
added to the evdev_event_type enum then GCC will give a nice warning for
that switch statement so we'd know we need to add a handler for it.

I think I would personally prefer to change the breaks to be ‘goto
handled’ too but I suppose that is a trade off for readability so I
won't complain either way.

The rest of the patches look good to me. I've tested it briefly and I
don't get the crashes anymore.

Regards,
- Neil

Ander Conselvan de Oliveira <conselvan2 at gmail.com> writes:

> From: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira at intel.com>
>
> 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


More information about the wayland-devel mailing list