[PATCH weston 1/2] evdev: Discard events from a touchscreen paired with an unplugged output

Ander Conselvan de Oliveira conselvan2 at gmail.com
Wed Apr 23 07:31:35 PDT 2014


On 04/23/2014 04:21 AM, Eoff, Ullysses A wrote:
> Hmmm... I think there's more to reconcile for touch device pairing/mapping.
>
> In device_added(), we assign a default output to a paired device when the
> the requested output isn't found.  That behavior just changed about a day
> ago to fix another bug.  But perhaps I wasn't seeing the big picture at the
> time when I changed that.  I admit that the notify_output_destroy() handler
> logic felt a little odd to me, though.

I think what we want is to restore the previous behavior and make sure 
the touch event is discarded if the output is NULL. It seems odd to me 
to map a touch screen that is explicitly mapped to another output. So in 
the end what we should get in all case is:

if the device is mapped to an output that is plugged, we set 
device->output to that output;

if the device is mapped to an output that is not plugged, we set 
device->output to NULL;

if the device is not mapped, we set device->output to the first output.

I'll send patches that do this.

Thanks
Ander

> Assigning the paired device's output to something (NULL or default) when the
> requested output doesn't exist should be the same logic as when the paired
> device's output is unplugged.  And possibly the same as when the device doesn't
> specify a pairing preference.  Even before this commit, the logic didn't reconcile
> with that notion either, afaict.
>
> And, of course, when the requested output is hotplugged the paired device's
> output needs to be reconciled (which is currently the case).
>
> ----
> U. Artie
>
>> -----Original Message-----
>> From: wayland-devel [mailto:wayland-devel-bounces at lists.freedesktop.org] On Behalf Of Ander Conselvan de Oliveira
>> Sent: Tuesday, April 22, 2014 8:02 AM
>> To: wayland-devel at lists.freedesktop.org
>> Cc: Conselvan De Oliveira, Ander
>> Subject: [PATCH weston 1/2] evdev: Discard events from a touchscreen paired with an unplugged output
>>
>> From: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira at intel.com>
>>
>> Commit 17bccaed intended to make the events coming from a touchscreen
>> paired with an unplugged output to be discarded, while an unpaired one
>> would just choose a different output. However, the logic was inverted
>> causing the opposite to happen.
>> ---
>>   src/evdev.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/evdev.c b/src/evdev.c
>> index bc8e5ef..9d97c87 100644
>> --- a/src/evdev.c
>> +++ b/src/evdev.c
>> @@ -602,7 +602,7 @@ notify_output_destroy(struct wl_listener *listener, void *data)
>>   	struct weston_compositor *c = device->seat->compositor;
>>   	struct weston_output *output;
>>
>> -	if (device->output_name) {
>> +	if (!device->output_name) {
>>   		output = container_of(c->output_list.next,
>>   				      struct weston_output, link);
>>   		evdev_device_set_output(device, output);
>> --
>> 1.8.3.2
>>
>> _______________________________________________
>> wayland-devel mailing list
>> wayland-devel at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/wayland-devel



More information about the wayland-devel mailing list