After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 748589 - Screen mapping incorrect for Cintiqs
Screen mapping incorrect for Cintiqs
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: wacom
3.16.x
Other Linux
: Normal normal
: ---
Assigned To: Carlos Garnacho
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2015-04-28 14:39 UTC by Benjamin Tissoires
Modified: 2018-01-15 10:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gnome-settings-daemon -r --debug log (59.62 KB, text/plain)
2015-04-30 14:30 UTC, Benjamin Tissoires
  Details
common: Ensure screen integrated devices get remapped on hotplug (1.89 KB, patch)
2018-01-15 10:13 UTC, Carlos Garnacho
committed Details | Review
Fix screen mapping for Cintiqs and others (1.32 KB, patch)
2018-01-15 10:13 UTC, Carlos Garnacho
committed Details | Review

Description Benjamin Tissoires 2015-04-28 14:39:40 UTC
Plugging a Wacom Cintiq (with an external display) on Gnome 3.16 makes the stylus mapped to the internal screen of the laptop instead of the external one.
If the Cintiq has touch, the touch is also mapped to the internal display.

It used to be automatically mapped to the cintiq screen, so it is a regression.
Comment 1 Benjamin Tissoires 2015-04-30 14:30:45 UTC
Created attachment 302657 [details]
gnome-settings-daemon -r --debug log

G-s-d log (with debug). I first replaced the session gsd with this one with only the external display plugged, then plugged the USB part of the Cintiq 22HDt.
Comment 2 Benjamin Tissoires 2015-04-30 17:50:57 UTC
I made some further debugging:
it looks like the heuristic functions to remap an input to a display are never called.
I tried a *very* hackish way to force the remapping by inserting:

-----
diff --git a/plugins/common/gsd-device-mapper.c b/plugins/common/gsd-device-mapper.c
index ce70fd0..3aa25b0 100644
--- a/plugins/common/gsd-device-mapper.c
+++ b/plugins/common/gsd-device-mapper.c
@@ -709,6 +709,8 @@ input_info_update_settings_output (GsdInputInfo *info)
        if (output == info->output)
                return;
 
+       output = NULL;
+
        if (output) {
                input_info_set_output (info, output, FALSE, FALSE);
                input_info_remap (info);
-----

This made things better and allowed to have the cursor under the stylus.
It however makes g-s-d crash with a Cintiq and an Intuos plugged at the same time.

I think the problem comes from the fact that an output gets automatically assigned to each new device through info->mapper->output_devices and so the heuristic to determine which input needs to get mapped to which output are never called.
Comment 3 Robbie Speed 2016-11-18 06:56:07 UTC
Any updates on this? The issue still seems to be present in gnome 3.20

I've had to resort to using xsetwacom to switch it to the correct monitor, but even then calibration will show on the laptop screen instead of the Cintiq. When the laptop screen is off, calibration is disabled.
Comment 4 kuraron.kuratan 2017-06-16 07:50:03 UTC
This is sadly still an issue using Gnome 3.22 running on Fedora 25 with Wayland.
Comment 5 Jason Gerecke 2017-06-21 16:41:44 UTC
I believe there have been some updates, but you might not see their effect if you're upgrading an existing installation. GNOME only goes through the screen mapping process once and then saves its best match. It will continue to use whatever it thought was the best match at the time until that setting is cleared.

To clear the setting and force GNOME to remap the tablet (hopefully with better results), use the following procedure:

1) Run `dconf-editor`

2) Navigate to `/org/gnome/desktop/peripherls/tablets`

3) Select the directory corresponding to your Cintiq (e.g. my Cintiq 24HD has a USB VID:PID of '056a:00f8' so I choose that. Check [1] for a list of other IDs.

4) One of the keys listed should be "display". Click on it to edit.

5) Change the "Custom value" to the following: ['', '', '']

6) Once you click "Apply", GNOME should automatically run its tablet mapping function. You can verify this by closing and re-running `dconf-editor`. The value for "display" should be filled in once again. If not, try disconnecting and reconnecting your Cintiq's USB connection.

Ideally GNOME will have mapped the tablet to the correct display at this point... If not, then this is still a bug.


[1]: http://linuxwacom.sourceforge.net/wiki/index.php/Device_IDs
Comment 6 kuraron.kuratan 2017-06-22 06:28:09 UTC
Thank you, this indeed helped - even calibration is displaying on the correct screen now. Do you know when that change introduced? Because the machine was installed with Fedora 24 and then upgraded to 25.

One thing to mention is that my machine is a laptop switching between two docking stations where one has a Wacom Cintiq 21UX2 and the other has no comparable display. Both stations have the same amount of screens but entirely different resolutions and manufacturers.

So the main problem now is, that there is no way to reset this setting using the gui. But again, thank you for the help!
Comment 7 Jason Gerecke 2017-06-22 18:19:29 UTC
Unfortunately, I couldn't possibly guess when the change was made...

I've done some more research and found that bug 739891 attempted to prevent the setting from becoming "stale" by updating the mapping when the displays change. That's great to hear, but doesn't seem to be quite doing the trick in your case. I would have expected the mapping to be updated when you connected/disconnected your laptop from the docking stations. Might be worth filing a bug about that.
Comment 8 Robbie Speed 2017-06-23 01:43:05 UTC
That fix worked for me as well. Calibration through the the gui works as it should now too. Thank you!
Comment 9 Carlos Garnacho 2017-07-21 10:29:33 UTC
Trying a bit harder, I think this is related to the order in which output/input are made known. If I reset the key, plug the output and then the input, it's able to find the output correctly at the time of mapping the input device. If I flip the plugging order, the input device gets first mapped to the laptop display, and it stays exactly the same when I plug the corresponding output.
Comment 10 Carlos Garnacho 2018-01-15 10:13:03 UTC
Created attachment 366812 [details] [review]
common: Ensure screen integrated devices get remapped on hotplug

GsdDeviceMapper used to refrain from remapping devices that already had
a configured output. This however results on wrong mapping when the input
device is plugged before the output, since the heuristics will attempt
really hard to find an output for the device before the real one is
available, and not remapped again when the output is plugged.

Fix this by forcing remapping on all screen-integrated devices on every
hotplug event, so the input device will get remapped to the right screen
(hopefully!) when it is plugged. This is not applied to devices mapped
to the builtin output, or those with no attached output at all, as in both
of these cases the configured output should be left static.
Comment 11 Carlos Garnacho 2018-01-15 10:13:12 UTC
Created attachment 366813 [details] [review]
Fix screen mapping for Cintiqs and others

Size-based input/output matching doesn't raise the "found" flag, which
would result on input_info_guess_candidates() still trying to assign the
builtin output to the input device if that is the only match found.

For screen integrated devices (i.e. not on the builtin output) this is
and undesirable possibility, setting the "found" flag to TRUE results on
the correct output being assigned.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Comment 12 Carlos Garnacho 2018-01-15 10:32:13 UTC
Benjamin/me worked on these patches that let screen-attached device pick the
right output independently of the input/output discovery order. They are now
in master and gnome-3-24

Attachment 366812 [details] pushed as 1c1a420 - common: Ensure screen integrated devices get remapped on hotplug
Attachment 366813 [details] pushed as 9b08637 - Fix screen mapping for Cintiqs and others