Commit 78bd7883 authored by Nate Graham's avatar Nate Graham
Browse files

[containments/panel] Fix panel applet configuration with touch

Despite this UI seeming very touch-centric, it was actually totally
boken for the touch use due to the use of mouse-specific code, namely
setting the current applet only when the mouse moved and also hiding the
tooltip when the mouse edited the area--neither of which are compatible
with authentic touch events when handled by a mouse area, because the
synthesized mouse position exits the mousearea as soon as the finger
used to touch the screen is retracted.

This is fixed by setting the current applet when clicked/touched as
well, and removing the onExited signal handler to hide the tooltip,
which was unnecessary anyway because the tooltip gets hidden by other
things and this still works.

Now touch interaction with panel applets while in panel edit mode
works as expected.

BUG: 439918
FIXED-IN: 5.22.5

(cherry picked from commit 97add87b)
parent e3d81dd7
......@@ -162,8 +162,6 @@ MouseArea {
onEntered: hideTimer.stop();
onExited: hideTimer.restart();
onCurrentAppletChanged: {
if (!currentApplet || !root.dragOverlay.currentApplet) {
......@@ -176,6 +174,18 @@ MouseArea {
onPressed: {
// Need to set currentApplet here too, to make touch selection + drag
// with with a touchscreen, because there are no entered events in that
// case
let item = currentLayout.childAt(mouse.x, mouse.y);
if (item) {
currentApplet = item;
root.dragOverlay.currentApplet = item;
tooltip.visible = true;
if (!root.dragOverlay.currentApplet) {
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment