diff options
author | U. Artie Eoff <ullysses.a.eoff@intel.com> | 2014-04-17 07:53:25 -0700 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2014-04-21 14:37:16 -0700 |
commit | 161c6c56944cdfbda9a1af7a8a2c34e8f7d41dae (patch) | |
tree | fab4fe013f6495ca8165319d720350e92460967d /src/libinput-device.c | |
parent | cd9e54537a5cb8acb00e99fbe6eeb74eafdd29fe (diff) | |
download | weston-161c6c56944cdfbda9a1af7a8a2c34e8f7d41dae.tar.gz |
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>
Diffstat (limited to 'src/libinput-device.c')
-rw-r--r-- | src/libinput-device.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libinput-device.c b/src/libinput-device.c index 2105aded..6a321a4c 100644 --- a/src/libinput-device.c +++ b/src/libinput-device.c @@ -259,6 +259,11 @@ void evdev_device_set_output(struct evdev_device *device, struct weston_output *output) { + if (device->output_destroy_listener.notify) { + wl_list_remove(&device->output_destroy_listener.link); + device->output_destroy_listener.notify = NULL; + } + device->output = output; device->output_destroy_listener.notify = notify_output_destroy; wl_signal_add(&output->destroy_signal, |