Bug 419392 - Settings for touch zone are not saved
Summary: Settings for touch zone are not saved
Status: ASSIGNED
Alias: None
Product: wacomtablet
Classification: Plasma
Component: general (show other bugs)
Version: 3.2.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Valerii Malov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-29 18:32 UTC by jan.claussen10
Modified: 2020-11-10 18:26 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jan.claussen10 2020-03-29 18:32:26 UTC
SUMMARY
Everytime I disconnect my external monitor, I the settings are being reset. It would be really great if these settings could be saved, once they are set. 

STEPS TO REPRODUCE
1. Connect external monitor to 2-in-1 device
2. Set touch zone to laptop screen
3. Disconnect external monitor

OBSERVED RESULT

EXPECTED RESULT
The settings are reset and the touch input lands on the external monitor
Comment 1 Daniel 2020-04-21 23:53:05 UTC
I also have this problem. It is very annoying. One could workaround this by executing the corresponding xsetwacom set … command, but this is not very practicabel.

One way to solve this would be to add a checkbox "always use the touchscreen/peninput as input for screen $SCREEN", which would be a viable solution, especially for 2-in-1 devices. Also for regular wacom-pads this would be a good solution, because their users simply don't activate that checkbox and thus they get their wanted behaviour.
Comment 2 Michael Zapf 2020-05-25 23:26:05 UTC
My issue seems to be the same: I am using a Cintiq tablet on HDMI-1 output, and I have to select the tablet area as the HDMI-1 area only so that the touch position and the pointer match.

However, every time I turn off the tablet and back on, the setting is reset to the complete screen (HDMI-0 + HDMI-1). This means I always have to redo the setting.
Comment 3 Daniel 2020-06-27 23:40:57 UTC
Actually, libwacom provides a flag, wether the tablet is built-in within a screen. (See https://github.com/linuxwacom/libwacom/blob/2dd3501fd3dd422127299a61692a798226ddfb11/libwacom/libwacom.c#L259)

This means that kde's wacomtablet should be able to identify such tablet and map the correct screen to it automatically. Further, all options which do not make sense for a screen-tablet should be disabled (relative tracking etc)
Comment 4 jan.claussen10 2020-06-28 08:35:02 UTC
Well, but it doesn’t work. As soon as I connect a screen the whole area of both screens is mapped. I habe to set it again every time. Maybe there should be a checkbox for that in KDE‘s settings then for cases where it doesn’t recognize the screen. I have an X380 Yoga and usually ThinkPads have great Linux support.
Comment 5 Michael Zapf 2020-06-28 12:47:06 UTC
For now, I wrote a script ~/bin/wacom that runs xsetwacom and xrandr to configure the tablet. I added two shortcuts to the plasma desktop for turning tablet support on and off. This is, of course, just a workaround.
Comment 6 Bug Janitor Service 2020-07-01 20:33:39 UTC
A possibly relevant merge request was started @ https://invent.kde.org/system/wacomtablet/-/merge_requests/1
Comment 7 Daniel 2020-07-01 20:38:36 UTC
Ok, so I have started to work on this a bit:

https://invent.kde.org/system/wacomtablet/-/merge_requests/1

I've implemented a boolean which reads from libwacom wether it is a built in device (tablet on screen or tablet on system). 

HOWEVER, the main thing, to determine the correct screen must still be done.

I know nothing about the gui stuff, but I would do it the following way:

If it is a built-in-device, disable the normal screenspace selector, and enable a special selector of the screen. This screen selection should be saved like normal in the config.
Comment 8 jan.claussen10 2020-07-01 23:08:42 UTC
Will try tomorrow. Thank you!
Comment 9 Valerii Malov 2020-07-02 21:15:15 UTC
Git commit 1d0b04478c9eb7df24a664ba7cc5096c5b0ee675 by Valerii Malov.
Committed on 02/07/2020 at 21:14.
Pushed by valeriymalov into branch 'master'.

don't override the screenspace in profile if the screen is missing

M  +12   -12   src/kded/tablethandler.cpp

https://invent.kde.org/system/wacomtablet/commit/1d0b04478c9eb7df24a664ba7cc5096c5b0ee675
Comment 10 Valerii Malov 2020-07-02 21:27:07 UTC
Daniel, indeed I'm not sure if there's a way to determine which screen the built-in tablet belongs to, although I haven't checked on libwacom API in a while. I'll try to look into that PR again later.

I've looked into the issue of losing settings, seems like a two-fold problem:
1. Single-screen setups are always mapped to desktop, not specific screen. IIRC this was done to support relative mapping mode since it only works when the tablet is mapped to the whole desktop.
2. When a screen goes missing, mapping defaults to desktop and this setting is saved, which breaks the mapping when the screen is reconnected.

For now as a workaround I've disabled saving the "default" desktop to tablet profile. This should in theory address 2nd and somewhat 1st issue. If anyone can build & test current master that would be swell.
Comment 11 Daniel 2020-07-02 21:42:40 UTC
Hi Valerii,

I've just built the current master and tested it. It doesn't seem to be fixed (the second issue in your list, at least).

This shows up in the log (But this might be intentional to some degree, when I see the comment in the code for this.):

> 
Couldn't load plugin "kcms/kcm_wacomtablet" : "The shared library was not found."  -- falling back to old-style loading from desktop file
org.kde.wacomtablet.kcm: Call to TabletAreaSelectionView::setupScreens made with no valid screens.
org.kde.wacomtablet.kcm: Internal error, invalid tablet geometry - "0 0 0 0"
org.kde.wacomtablet.kcm: Call to TabletAreaSelectionView::setupScreens made with no valid screens.
org.kde.wacomtablet.kcm: Internal error, invalid tablet geometry - "0 0 0 0"


If I connect my laptop to an external screen, set the touch&stylus screen area to only the laptop screen, then save it. Now if I disconnect & reconnect the external screen, the touch&stylus screen area are the full virtual screen, not only the laptop screen as previously set.
Comment 12 jan.claussen10 2020-11-10 18:26:55 UTC
I have found a workaround for me some time ago. Since I wrote a script that opens Xournal++ when I press the top button of my Bamboo Ink, I also made it map the Wacom tablet onto my laptop's monitor, which is called eDP1 in my case. I am aware that this might not be the case for all laptops. Maybe xrandr should provide a possibility to detect differentiate it from the external monitor. Here are my commands from the script

xsetwacom --set "Wacom Pen and multitouch sensor Pen stylus" MapToOutput "eDP1"
xsetwacom --set "Wacom Pen and multitouch sensor Pen eraser" MapToOutput "eDP1"
xsetwacom --set "Wacom Pen and multitouch sensor Finger touch" MapToOutput "eDP1"