This is an automated email from the ASF dual-hosted git repository.
hansva pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/hop.git
The following commit(s) were added to refs/heads/main by this push:
new e46b207ad7 fix drag for Hop Web, fixes #7227 (#7241)
e46b207ad7 is described below
commit e46b207ad7e1918165cb39fec760b239ba30e002
Author: Hans Van Akelyen <[email protected]>
AuthorDate: Mon Jun 8 09:33:09 2026 +0200
fix drag for Hop Web, fixes #7227 (#7241)
---
.../hop/ui/hopgui/file/pipeline/HopGuiPipelineGraph.java | 16 ++++++++++++++++
.../hop/ui/hopgui/file/workflow/HopGuiWorkflowGraph.java | 13 +++++++++++++
2 files changed, 29 insertions(+)
diff --git
a/ui/src/main/java/org/apache/hop/ui/hopgui/file/pipeline/HopGuiPipelineGraph.java
b/ui/src/main/java/org/apache/hop/ui/hopgui/file/pipeline/HopGuiPipelineGraph.java
index d9b43df355..a3f1c6a14b 100644
---
a/ui/src/main/java/org/apache/hop/ui/hopgui/file/pipeline/HopGuiPipelineGraph.java
+++
b/ui/src/main/java/org/apache/hop/ui/hopgui/file/pipeline/HopGuiPipelineGraph.java
@@ -817,6 +817,22 @@ public class HopGuiPipelineGraph extends
HopGuiAbstractGraph
Point p = currentTransform.getLocation();
iconOffset = new Point(real.x - p.x, real.y - p.y);
+
+ // The RAP/web client does not deliver mouse-move events while a
button is held, so the
+ // movement threshold in mouseMove() can never fire during a
press. Arm the drag right
+ // away on mouse-down so the transform follows the cursor and is
dropped on mouse-up;
+ // native SWT keeps the threshold behaviour to distinguish a click
from a drag.
+ if (EnvironmentUtils.getInstance().isWeb() && event.button == 1 &&
!shift && !control) {
+ iconDragCommitted = true;
+ dragSelection = true;
+ canvas.setData("mode", "drag");
+ selectedTransforms = pipelineMeta.getSelectedTransforms();
+ selectedTransform = currentTransform;
+ pipelineGridDelegate.onPipelineSelectionChanged();
+ for (ITransformSelectionListener listener :
currentTransformListeners) {
+ listener.onUpdateSelection(currentTransform);
+ }
+ }
}
redraw();
done = true;
diff --git
a/ui/src/main/java/org/apache/hop/ui/hopgui/file/workflow/HopGuiWorkflowGraph.java
b/ui/src/main/java/org/apache/hop/ui/hopgui/file/workflow/HopGuiWorkflowGraph.java
index 44ee491f69..8fb94e9ad9 100644
---
a/ui/src/main/java/org/apache/hop/ui/hopgui/file/workflow/HopGuiWorkflowGraph.java
+++
b/ui/src/main/java/org/apache/hop/ui/hopgui/file/workflow/HopGuiWorkflowGraph.java
@@ -666,6 +666,19 @@ public class HopGuiWorkflowGraph extends
HopGuiAbstractGraph
Point p = currentAction.getLocation();
iconOffset = new Point(real.x - p.x, real.y - p.y);
+
+ // The RAP/web client does not deliver mouse-move events while a
button is held, so the
+ // movement threshold in mouseMove() can never fire during a
press. Arm the drag right
+ // away on mouse-down so the action follows the cursor and is
dropped on mouse-up;
+ // native
+ // SWT keeps the threshold behaviour to distinguish a click from a
drag.
+ if (EnvironmentUtils.getInstance().isWeb() && event.button == 1 &&
!shift && !control) {
+ actionDragCommitted = true;
+ dragSelection = true;
+ canvas.setData("mode", "drag");
+ selectedActions = workflowMeta.getSelectedActions();
+ selectedAction = currentAction;
+ }
}
updateGui();
done = true;