nexus511 / gpd-ubuntu-packages

This repository shall provide the base for building ubuntu packages from most of the patches currently used to get linux on the gpd-pocket.
GNU General Public License v3.0
73 stars 4 forks source link

Associate touchscreen with display #16

Closed sagebind closed 7 years ago

sagebind commented 7 years ago

Make screen rotation apply touchscreen transformation automatically under Wayland by associating the touchscreen input device with the internal display.

There's not much documentation for the peripherals/touchscreens keys, but I found an explanation in the schema file here that says the display key has the format [vendor, product, serial].

When under Xorg, the display is called DSI1 with vendor ???, product 0x000, serial 0x00000000. When under Wayland, it is apparently called DSI-1 instead with all properties set to unknown.

Setting this key globally causes the touchscreen input orientation to match the display orientation in the login screen and for all users when under Wayland. I have not tested how this affects Xorg yet.

Also, you should update the dconf database after installing keys, otherwise a reboot is required to take effect.

jeanblanchard commented 7 years ago

This appears to fix #14 in Xorg and Wayland, in Gnome and GDM.

To note: I had to configure the display in Gnome Wayland to rotate it properly. This added a third configuration in ~/.config/monitors.xml, which I then had to copy to /var/lib/gdm3/.config/monitors.xml.

  <configuration>
    <clone>no</clone>
    <output name="DSI1">
      <vendor>unknown</vendor>
      <product>unknown</product>
      <serial>unknown</serial>
      <width>1920</width>
      <height>1200</height>
      <rate>60.384120941162109</rate>
      <x>0</x>
      <y>0</y>
      <rotation>right</rotation>
      <reflect_x>no</reflect_x>
      <reflect_y>no</reflect_y>
      <primary>yes</primary>
      <presentation>no</presentation>
      <underscanning>no</underscanning>
    </output>
  </configuration>

(Note the refresh rate is what's different from the previous one)

An interesting side-effect is that the scale in GDM (Wayland or Xorg) had changed, making it tiny.

nexus511 commented 7 years ago

Rebased and merged into bugfix/wayland_touch_rotation .

I will test if this causes problems on Xubuntu. If not, I will merge it into the development branch and put the changes to the deb-repository.

Thank you for your work. This looks promising to fix the existing problems.

sagebind commented 7 years ago

@jeanblanchard The scaling became tiny probably from running docnf update, which probably applied the other keyfiles already in the package, specifically this line in 01scale:

scaling-factor=uint32 1

which is too small of a scale. I can open a PR to change this to a scale of 0 as according to my discovery of automatic scaling I posted on Reddit.

My guess is that the two keyfiles already in the package have had no effect so far for users unless they ran dconf update manually. On my system it seems that dconf update actually is not run on boot.

nexus511 commented 7 years ago

Yes, dconf update is not run properly. This is the reason for the scaling issues.