[PATCH weston 09/25] libinput: do not switch output associations on disable

Pekka Paalanen ppaalanen at gmail.com
Thu Apr 5 14:15:44 UTC 2018


On Thu, 5 Apr 2018 16:10:53 +1000
Peter Hutterer <peter.hutterer at who-t.net> wrote:

> On Fri, Mar 23, 2018 at 02:00:49PM +0200, Pekka Paalanen wrote:
> > From: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
> > 
> > If an input device is associated to an output that then gets disabled,
> > there is no case where associating to a different output would be
> > correct.  
> 
> just a general note here, especially in light of Jason's comments:
> this statement above isn't true for external tablet devices like
> the Wacom Intuos series (the ones *not* integrated into a touchscreen).
> There are workflows where the device is used in absolute mode and mapped to
> a specific monitor even though it's external like a touchpad. In fact, IMO
> it's the more sane mode for these devices as the only other alternative is
> to have the tablet span all outputs, making everything a bit weird.
> 
> With those devices, unplugging an output should thus map the tablet to the
> remaining one.
> 
> It's not yet something weston needs to worry about given the other things
> that you need in place for this to work (specifically: tablet area ratio to
> monitor ratio). But keep this filed away in the back of your head anyway.

Hi,

ok, good to know. So while this patch is correct for actual
touchscreens, it's not correct for other kinds of devices. We'll need
to do it by device type. Given only touchscreens are supported for now,
this patch has the correct behaviour.

The previous patch "libweston: require connected heads for input
devices" should have the same effect and the same issue. By your
rationale, unplugging a force-enabled output should lead to the tablet
device jumping onto another output rather than being disabled.


Thanks,
pq

> 
> Cheers,
>    Peter
> 
> > 
> > The output association is used for absolute positioned input devices,
> > and an input device like a touchscreen cannot ever be automatically
> > valid for more than one possible output - the touchscreen display
> > device.
> > 
> > Therefore do not automatically reassing implicitly associated input
> > devices to another output. This removes some log spam on shutdown.
> > 
> > In fact, if there can be more than one output at any time, absolute
> > input devices must be explicitly configured to associate with the
> > correct output, or the results are essentially undefined in any case.
> > 
> > Signed-off-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
> > ---
> >  libweston/libinput-device.c | 12 ++----------
> >  1 file changed, 2 insertions(+), 10 deletions(-)
> > 
> > diff --git a/libweston/libinput-device.c b/libweston/libinput-device.c
> > index dbbaae32..e1738613 100644
> > --- a/libweston/libinput-device.c
> > +++ b/libweston/libinput-device.c
> > @@ -434,16 +434,8 @@ notify_output_destroy(struct wl_listener *listener, void *data)
> >  	struct evdev_device *device =
> >  		container_of(listener,
> >  			     struct evdev_device, output_destroy_listener);
> > -	struct weston_compositor *c = device->seat->compositor;
> > -	struct weston_output *output;
> > -
> > -	if (!device->output_name && !wl_list_empty(&c->output_list)) {
> > -		output = container_of(c->output_list.next,
> > -				      struct weston_output, link);
> > -		evdev_device_set_output(device, output);
> > -	} else {
> > -		evdev_device_set_output(device, NULL);
> > -	}
> > +
> > +	evdev_device_set_output(device, NULL);
> >  }
> >  
> >  /**
> > -- 
> > 2.16.1
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20180405/307b0321/attachment.sig>


More information about the wayland-devel mailing list