Commit 2eb0c67b authored by Marco Martin's avatar Marco Martin Committed by Vlad Zahorodnii
Browse files

Fix dragging especially by touch

The drag manager of a window now can take over from anything, so that
the events to initiate a drag are not stolen by the tap handlers
(fixes the drag starts only the second time is tried issue)

On wayland drag by touch was completely broken by the supportsclosewindows check,
now the touch drag handler is always active and the check of the property is done only
when the drag is over

BUG:455268


(cherry picked from commit c1a536a5)
parent 4531e6c0
Pipeline #193221 passed with stage
in 16 minutes and 41 seconds
...@@ -398,7 +398,7 @@ FocusScope { ...@@ -398,7 +398,7 @@ FocusScope {
component DragManager : DragHandler { component DragManager : DragHandler {
id: dragHandler id: dragHandler
target: null target: null
grabPermissions: PointerHandler.CanTakeOverFromHandlersOfSameType grabPermissions: PointerHandler.CanTakeOverFromAnything
readonly property double targetScale: { readonly property double targetScale: {
if (!heap.supportsDragUpGesture) { if (!heap.supportsDragUpGesture) {
...@@ -433,7 +433,6 @@ FocusScope { ...@@ -433,7 +433,6 @@ FocusScope {
DragManager { DragManager {
id: touchDragHandler id: touchDragHandler
acceptedDevices: PointerDevice.TouchScreen acceptedDevices: PointerDevice.TouchScreen
enabled: heap.supportsCloseWindows
readonly property double targetOpacity: { readonly property double targetOpacity: {
if (!heap.supportsCloseWindows) { if (!heap.supportsCloseWindows) {
return 1; return 1;
...@@ -444,11 +443,8 @@ FocusScope { ...@@ -444,11 +443,8 @@ FocusScope {
} }
onActiveChanged: { onActiveChanged: {
if (!heap.supportsCloseWindows) {
return;
}
if (!active) { if (!active) {
if (targetOpacity < 0.4) { if (heap.supportsCloseWindows && targetOpacity < 0.4) {
thumb.client.closeWindow(); thumb.client.closeWindow();
} }
} }
......
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