Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better input device to output mapping #940

Open
agx opened this Issue May 3, 2018 · 6 comments

Comments

Projects
None yet
3 participants
@agx
Copy link
Contributor

agx commented May 3, 2018

Except for the X11/Wayland backends this has to be configured manually. Suggestions from #925 by @Ongy and @emersion :

  • Get the mapping of devices <-> outputs over some udev variable (has to be set by user)
    - Can be shared among wlroots compositors
    - I think udev needs root to setup
    - has to be configured by hand, ahead of time
  • Provide some metric to map:
    - (e.g. LVDS/eDP are more likely to be touch)
    - The aspect ratio of the output and input device can be used too.
    - works out of the box for users
    - should be shareable (if not code, at least the approach)
    - it's just a guessing metric, can go wrong
@emersion

This comment has been minimized.

Copy link
Member

emersion commented May 3, 2018

Get the mapping of devices <-> outputs over some udev variable (has to be set by user)

This is already implemented.

Provide some metric to map:

This needs to be opt-in for the compositor. A good start would be to do it entirely in rootston, and then we could decide it to add it as a helper function to wlroots.

@agx

This comment has been minimized.

Copy link
Contributor Author

agx commented May 3, 2018

Yeah, that's why I flagged this "rootston" for the moment. Regarding udev you're talking about libinput_device_get_output_name ? That seems to deprecated (https://wayland.freedesktop.org/libinput/doc/latest/group__device.html#gaf48626f6190e9c9bc14abb704e66cc22). I did not spot this when reviewing the code.

@emersion

This comment has been minimized.

Copy link
Member

emersion commented May 3, 2018

That seems to deprecated

It's not deprecated, it's just that the WL_OUTPUT udev property is ill-defined. But picking another udev property wouldn't improve the situation, so I chose just to stick with this one. I still wanted to support the udev thing because this can allow manufacturers (like Purism?) to install by default a udev rule on their devices.

@agx

This comment has been minimized.

Copy link
Contributor Author

agx commented May 3, 2018

I meant to say discouraged not deprecated. Above link says: "Use of this function is discouraged". That's why I kept it in the list of things above (since the udev story likely does not end here yet). Having WL_OUTPUT honored is already great!

@ddevault

This comment has been minimized.

Copy link
Member

ddevault commented May 3, 2018

  • (e.g. LVDS/eDP are more likely to be touch)

I don't like this sort of approach, or any of the other heuristic approaches.

Aside from the udev thing, which would be fine, I don't think any of this should live in rootston or wlroots.

@emersion

This comment has been minimized.

Copy link
Member

emersion commented Sep 18, 2018

libwacom can be used to do the mapping for some devices (should be pretty reliable).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.