input: fix input device map to output if it doesn't exist.
authorU. Artie Eoff <ullysses.a.eoff@intel.com>
Thu, 17 Apr 2014 14:53:25 +0000 (07:53 -0700)
committerKristian Høgsberg <krh@bitplanet.net>
Mon, 21 Apr 2014 21:37:16 +0000 (14:37 -0700)
commit161c6c56944cdfbda9a1af7a8a2c34e8f7d41dae
treefab4fe013f6495ca8165319d720350e92460967d
parentcd9e54537a5cb8acb00e99fbe6eeb74eafdd29fe
input: fix input device map to output if it doesn't exist.

If an input device wants to map to an output that does not
exist, then just map it to the first output.

Also, if a device is mapped to an output that gets unplugged then
it gets default mapped to the first output in the output destroy
listener.  However, the original output destroy listener needs to
be removed before adding the new listener for the first output,
otherwise the list gets corrupted.

Later if the other output is plugged back in, we remap the device
to it.  In that case, we should remove the destroy listener for
the first output.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=77341

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
src/evdev.c
src/libinput-device.c
src/libinput-seat.c
src/udev-seat.c