Bug 374778 - Touchscreen offset caused by decorations
Summary: Touchscreen offset caused by decorations
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: input (show other bugs)
Version: 5.8.5
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL: https://phabricator.kde.org/D4074
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-08 20:09 UTC by Kyle Kauffman
Modified: 2017-01-25 12:59 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
mgraesslin: Wayland+
mgraesslin: ReviewRequest+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle Kauffman 2017-01-08 20:09:34 UTC
I'm not sure if this is a KWin bug or some other component, but opening one here since I've only reproduced it under KDE/Wayland. 

On my laptop, the touchpad works fine in both X11 and wayland (sans the inability to configure it on wayland with 5.8.5). Under KDE/X11, the touchscreen also works fine. When I switch to KDE/Wayland, the touchscreen has a vertical offset for specific apps (that is, i have to press above the button for it to register). 

Lists of types of apps I've tried (all under a plasma-wayland session):

GTK apps (via Xwayland): Centered
KDE Panel: Centered
Clock Plasmoid on Desktop: Centered
Window Decorations: Centered (both title bar clicks + min/max/close buttons)
Konsole: Offset
Kate: Offset
Settings App: Offset

The pattern so far suggests the offset is only Qt apps which are not plasmoids (for some reason?).
Comment 1 Martin Flöser 2017-01-09 05:55:34 UTC
Maybe related to the decorations? Could you test whether removing the deco fixes the offset?
Comment 2 Martin Flöser 2017-01-09 16:57:10 UTC
Just gave it a try on my touch screen and noticed the offset. I'm quite certain it's related to decos.

Interesting that I didn't notice myself. Shows how often I use the touch screen.
Comment 3 Martin Flöser 2017-01-10 18:32:51 UTC
Git commit e616925fb0528602906aa888318e211a91382ce4 by Martin Gräßlin.
Committed on 10/01/2017 at 18:27.
Pushed by graesslin into branch 'master'.

[autotests/integration] Add test case for touch and decoration

The test for touch points is extended for decorated windows and as
the test shows the client pos offset is not considered correctly.

M  +31   -7    autotests/integration/touch_input_test.cpp

https://commits.kde.org/kwin/e616925fb0528602906aa888318e211a91382ce4
Comment 4 Martin Flöser 2017-01-10 19:15:15 UTC
Unfortunately it looks like it needs a fix in KWayland and that means we cannot fix for Plasma 5.9. We missed the time slot by just a few days :-(
Comment 5 Martin Flöser 2017-01-10 19:33:29 UTC
At least a workaround can be done even without new API in KWayland: https://phabricator.kde.org/D4074
Comment 6 Kyle Kauffman 2017-01-11 00:43:32 UTC
Looks great-- unfortunately I can't test myself yet as I've had no success getting master to build on my setup.
Comment 7 Martin Flöser 2017-01-25 12:59:12 UTC
Git commit 7e89c518237b175ecdd4df33bb4f03c2bbffb0ab by Martin Gräßlin.
Committed on 25/01/2017 at 12:58.
Pushed by graesslin into branch 'Plasma/5.9'.

Add workaround for touch input offset for decorated windows

Summary:
If a Wayland window is decorated the decoration size was not considered
when passing touch points to the Wayland window. For pointer input this
is considered and implemented through the input transformation matrix
which KWayland::Server::SeatInterface accepts. This should also be done
for Touch. Unfortunately the frameworks version for Plasma 5.9 is already
tagged and done and we cannot depend on new API.

Thus this change tries to workaround by calculating the proper offset
through the input transformation matrix. It isn't nice but fixes the
problem for now.

Test Plan: Only in unit test, real test still missing

Reviewers: #plasma_on_wayland, #kwin

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D4074

M  +0    -3    autotests/integration/touch_input_test.cpp
M  +4    -2    touch_input.cpp

https://commits.kde.org/kwin/7e89c518237b175ecdd4df33bb4f03c2bbffb0ab