Skip to content

Input / output mappings

Guido Günther requested to merge guidog/phoc:tablet-gobject into master

With the work in !303 (merged) (but based on !306 (merged) and !305 (merged)) as well we can make PhocTablet use PhocInputDevice too and hence add input / output mappings for tablets and touchscreens.

This MR does not yet contain the actual mapping code that looks at

/org/gnome/desktop/peripherals/touchscreens/

for the mappings but that's basically the "only" thing left when the above cleanups are in.

We look at

  org.gnome.desktop.peripherals.touchscreen
  org.gnome.desktop.peripherals.tablets

by vendor and product as e.g. filled in by libinput. If there's an output match that up with make/model/serial of the currently known outputs and establish a mapping if it matches.

These can be set via

gsettings set org.gnome.desktop.peripherals.touchscreen:/org/gnome/desktop/peripherals/touchscreens/1234:abcd/ output "['vendor', 'make', 'model']"

for touch or to map a tablet to an external screen:

gsettings set org.gnome.desktop.peripherals.tablet:/org/gnome/desktop/peripherals/touchscreens/1b96:0f01/ output "['Hewlett Packard', 'HP w2207', 'CZD74909W7']"

If no match is found we fall back to using the built-in display as before.

Since we lookup outputs explicitly now we can drop the loop over all outputs in phoc_seat_configure_cursor() which also fixes the issue that we were adding touch devices at random to desktop->input_output_map which basically only worked since phones are usually booted with touch and one display.

Works for me on an hacked up intel device and doesn't break touch on the Librem 5.

Helps #6 Closes: #35 (closed)

Edited by Guido Günther

Merge request reports