Bug 403806 - please support a right-click (via a long press) on touchscreens.
Summary: please support a right-click (via a long press) on touchscreens.
Status: RESOLVED NOT A BUG
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: 5.14.90
Platform: Neon Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
: 404994 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-01-31 16:12 UTC by Russ Hay
Modified: 2019-03-09 08:45 UTC (History)
2 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 Russ Hay 2019-01-31 16:12:14 UTC
As touchscreen devices become more prevalent, can the capability to simulate a right-click with a long touch on the screen be added? I know this is available in other DE's - can you advise if this is on any KDE roadmap?  

Apologies for not contributing a patch on this, but if I had the capability I would.
Comment 1 Martin Flöser 2019-01-31 18:11:17 UTC
I'm sorry, but no that cannot be implemented.
Comment 2 Patrick Silva 2019-02-01 21:07:34 UTC
(In reply to Martin Flöser from comment #1)
> I'm sorry, but no that cannot be implemented.

Why not?
Comment 3 Martin Flöser 2019-02-02 06:34:08 UTC
Because that needs to be done on application level, not on compositor level. Imagine an app using long press not for right click, but a different action. That would break immediately if we would steal the long press. At compositor level we do not know what the application is going to do on long press.
Comment 4 Russ Hay 2019-02-03 00:12:42 UTC
If Kwin/Wayland gesture recognition is implemented, then surely that include some analog for a right-click, whether that's a long-press or some thing else? Is there some forum/mailing list where this can be discussed other than a bug report?
Comment 5 Martin Flöser 2019-02-03 08:14:32 UTC
This cannot be implemented in the compositor. There's no point in discussing it.
Comment 6 Martin Flöser 2019-02-03 16:41:50 UTC
Now I'm in front of a keyboard and I can explain in more detail.

On Wayland touch and mouse are different concepts. The mouse cursor - unlike on X11 - does not warp to the position where you touched. Given that alone a mouse click emulation through touch events simply doesn't make sense in the compositor. It would make sense if and only if the application indicates that it doesn't support touch events. But all applications do indicate that they support touch.

For the compositor this means the application is able to handle touch events just fine and to provide useful interactions. A compositor cannot know:
 * whether the application uses long press to emulate right click mouse behavior
 * whether the application does nothing on long press
 * whether there is a specific action for long press

For example QtQuick Controls 2 ToolTip suggests in the documentation to use a long press to trigger tooltips which otherwise are shown on mouse hover - see: https://doc.qt.io/qt-5/qml-qtquick-controls2-tooltip.html

Such functionality instantly gets broken when the compositor starts to steal the long press. We would have to steal it as otherwise two actions would be triggered: the one on long press and the right click emulation.

Furthermore also in future a gesture system would not be possible to support this due to the separation of touch and mouse in Wayland. This is also kept in KWin and we cannot "just" emit a right mouse button. In Wayland speak we would have to focus the surface, warp the pointer and send a button down and up. This would instantly trigger KWin internal functionality such as closing the virtual keyboard on mouse interaction or showing the mouse cursor again which gets hidden on touch events.

Overall this is really not a functionality belonging in the compositor. You might find more luck with toolkits, but I doubt they would implement such behavior.
Comment 7 Christoph Feck 2019-03-09 08:45:48 UTC
*** Bug 404994 has been marked as a duplicate of this bug. ***