Touch input is offset with two screens (even appearing on the wrong screen) in Xorg sessions

Bug #1821933 reported by Will Cooke
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mutter
Fix Released
Unknown
mutter (Ubuntu)
Fix Released
High
Unassigned

Bug Description

Using touch input with one screen seems fine.
However, when connecting a second screen the touch event happens at the wrong coordinates.

Steps to reproduce
1. Starting with a single screen touch and hold on the background and drag. The rubber band selector shows up with the moving corner at your finger.
2. Connect a second screen
3. Do the same touch and drag as in step 1 and notice that the moving corner is offset to the right and slightly below where the touch is happening.
---
ProblemType: Bug
ApportVersion: 2.20.10-0ubuntu23
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
DisplayManager: gdm3
DistroRelease: Ubuntu 19.04
GsettingsChanges: b'org.gnome.desktop.interface' b'gtk-im-module' b"'ibus'"
InstallationDate: Installed on 2019-03-28 (0 days ago)
InstallationMedia: Ubuntu 19.04 "Disco Dingo" - Alpha amd64 (20190326.2)
Package: gnome-shell 3.32.0-1ubuntu1
PackageArchitecture: amd64
ProcVersionSignature: Ubuntu 5.0.0-7.8-generic 5.0.0
Tags: disco
Uname: Linux 5.0.0-7-generic x86_64
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip lpadmin plugdev sambashare sudo
_MarkForUpload: True

Related branches

Will Cooke (willcooke)
tags: added: rls-dd-incoming
Will Cooke (willcooke)
Changed in gnome-shell (Ubuntu):
status: New → Confirmed
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Will,

Can you detail what scaling factors you are using, as well as running:

  xrandr > xrandr.txt

and attach the file 'xrandr.txt'?

tags: added: disco
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Please also run:

  apport-collect 1821933

so it's clear in the bug what package versions are affected.

Revision history for this message
Will Cooke (willcooke) wrote :

No scaling set. So 100%

tags: added: apport-collected
description: updated
Revision history for this message
Will Cooke (willcooke) wrote : Dependencies.txt

apport information

Revision history for this message
Will Cooke (willcooke) wrote : ProcCpuinfoMinimal.txt

apport information

Revision history for this message
Will Cooke (willcooke) wrote : ProcEnviron.txt

apport information

Revision history for this message
Daniel van Vugt (vanvugt) wrote : Re: Touch input is misaligned with two screens

Will,

1. Is the external monitor also a touch screen or just the laptop?

2. Would you say the offset is the same as that of the desktop workarea? (thickness of the top panel plus thickness of the Ubuntu dock)

affects: gnome-shell (Ubuntu) → gnome-shell-extension-desktop-icons (Ubuntu)
Revision history for this message
Will Cooke (willcooke) wrote :

Just the laptop is touch screen. Monitor is normal monitor.

I recorded a quick video to try and show what's going on:

https://www.youtube.com/watch?v=bbr1ywNpIgc

Revision history for this message
Daniel van Vugt (vanvugt) wrote : Re: Touch input is offset with two screens (even appearing on the wrong screen)

More questions:

  * From the video it looks like the rubber band moves faster than your finger. Does it only happen when desktop scaling is >100%?

  * Does touch respond in the right place for the shell or apps?

summary: - Touch input is misaligned with two screens
+ Touch input is offset with two screens (even appearing on the wrong
+ screen)
tags: added: multimonitor touch
Changed in gnome-shell (Ubuntu):
status: New → Incomplete
status: Incomplete → New
Changed in gnome-shell-extension-desktop-icons (Ubuntu):
status: Confirmed → New
Revision history for this message
Will Cooke (willcooke) wrote :

No additional scaling is set, everything is 100%.
It does feel like there is some acceleration going on though.

The offset seems consistent to shell, apps and the backdrop. e.g. I position a window on the right hand screen and I can grab the top of it by dragging on the left screen.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

It sounds like touches are being scaled to stage coordinates instead of view coordinates. So a touch halfway across the touch screen gets mapped to a desktop location halfway across all monitors. Just a guess.

no longer affects: gnome-shell-extension-desktop-icons (Ubuntu)
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gnome-shell (Ubuntu):
status: New → Confirmed
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

The problem appears to be that clutter_input_device_evdev_translate_coordinates has no idea that the stage might include multiple monitors:

https://gitlab.gnome.org/GNOME/mutter/blob/master/clutter/clutter/evdev/clutter-input-device-evdev.c#L1509

Sadly I can't see any information that would help to correct it either. It would be a bit of a redesign.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

That would be a consequence of the "touch screen" input device not having any relation in software to the "screen" output device. They are very separate things :(

Revision history for this message
Daniel van Vugt (vanvugt) wrote :
Revision history for this message
Daniel van Vugt (vanvugt) wrote :
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Sorry, ignore the above, they are wrong. It is a bit more non-trivial than that.

Revision history for this message
Will Cooke (willcooke) wrote :

More testing:

Testing on Fedora with GNOME 3.32 under their default wayland session, touch events seem to be positioned correctly.

Testing on Disco under the Wayland session touch on the dock and parts of shell that are on the left of the screen seems to work, but touch-dragging on the background doesnt seem to work at all.

Revision history for this message
Will Cooke (willcooke) wrote :

This bug is being marked notfixing. That doesn't mean it wont get fixed, but that we won't block release on it.

tags: added: releasenotes rls-dd-notfixing
removed: rls-dd-incoming
tags: added: desktop-trello-import rls-dd-incoming
removed: releasenotes rls-dd-notfixing
Revision history for this message
Will Cooke (willcooke) wrote : Automatically added comment
tags: removed: desktop-trello-import
Revision history for this message
Daniel van Vugt (vanvugt) wrote : Re: Touch input is offset with two screens (even appearing on the wrong screen)

Will,

Please test the previous mutter release debs, just in case it's an xrandr scaling regression. The previous release is here:

  https://launchpad.net/ubuntu/+source/mutter/3.32.0-1/+build/16489975

Changed in gnome-shell (Ubuntu):
status: Confirmed → Incomplete
affects: gnome-shell (Ubuntu) → mutter (Ubuntu)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

If ^^^ reverting the version of mutter installed ^^^ doesn't fix the bug then please try the PPA (https://launchpad.net/~vanvugt/+archive/ubuntu/lp1821933). Because your feedback on that will guide the design of a proper fix then.

Revision history for this message
Will Cooke (willcooke) wrote :

In reply to comment #21:

$ apt-cache policy mutter
mutter:
  Installed: 3.32.0-1
  Candidate: 3.32.0-1ubuntu1
  Version table:
     3.32.0-1ubuntu1 500
        500 http://gb.archive.ubuntu.com/ubuntu disco/main amd64 Packages
 *** 3.32.0-1 100
        100 /var/lib/dpkg/status

The result is the same. Same offset etc.

Revision history for this message
Will Cooke (willcooke) wrote :

In reply to comment #22:

$ apt-cache policy mutter
mutter:
  Installed: 3.32.0-1ubuntu1vv1
  Candidate: 3.32.0-1ubuntu1vv1
  Version table:
 *** 3.32.0-1ubuntu1vv1 500
        500 http://ppa.launchpad.net/vanvugt/lp1821933/ubuntu disco/main amd64 Packages
        100 /var/lib/dpkg/status
     3.32.0-1ubuntu1 500
        500 http://gb.archive.ubuntu.com/ubuntu disco/main amd64 Packages

Made no difference I'm afraid.

Changed in mutter (Ubuntu):
status: Incomplete → Triaged
Iain Lane (laney)
tags: added: rls-dd-notfixing
removed: rls-dd-incoming
Revision history for this message
Will Cooke (willcooke) wrote :

Removed the upstream but I logged and replaced it with one which was already logged, and fixed.

no longer affects: mutter
Changed in mutter (Ubuntu):
importance: Undecided → High
status: Triaged → Fix Committed
Changed in mutter:
status: Unknown → Fix Released
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Oh, wow, fixed in mutter 3.32.1 already?!

https://gitlab.gnome.org/GNOME/mutter/merge_requests/503

tags: added: fixed-in-3-32.1 fixed-upstream
summary: Touch input is offset with two screens (even appearing on the wrong
- screen)
+ screen) in Xorg sessions
tags: removed: rls-dd-notfixing
tags: added: fixed-in-3.32.1
removed: fixed-in-3-32.1
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Fix committed via Debian:

mutter (3.32.0+git20190410-1) experimental; urgency=medium

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mutter - 3.32.0+git20190410-1ubuntu1

---------------
mutter (3.32.0+git20190410-1ubuntu1) disco; urgency=medium

  * Merge with debian git snapshot (LP: #1820542), remaining changes:
    + debian/control:
      - Update VCS flags to point to launchpad
      - Update maintainer to ubuntu
    + debian/gbp.conf: update branch to point to ubuntu/master
    + debian/patches/x11-Add-support-for-fractional-scaling-using-Randr.patch:
      - X11: Add support for fractional scaling using Randr
  * d/p/x11-Add-support-for-fractional-scaling-using-Randr.patch:
    - Refreshed.

 -- Marco Trevisan (Treviño) <email address hidden> Wed, 10 Apr 2019 20:12:29 -0500

Changed in mutter (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.