This is an automated email from the ASF dual-hosted git repository.

mattcasters 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 e1ee6aa052 Issue #8760 : Release the mouse capture before opening the 
context dialog on right click (#8818)
e1ee6aa052 is described below

commit e1ee6aa0521bce45b9ab3d7b29e35d8eab02222a
Author: Nicolas Adment <[email protected]>
AuthorDate: Fri Oct 9 15:14:21 2026 +0200

    Issue #8760 : Release the mouse capture before opening the context dialog 
on right click (#8818)
    
    With "Use right click for the context dialog" enabled on Windows, hovering
    over the items of the context dialog no longer moved the selection; only the
    keyboard did.
    
    SWT captures the mouse on the graph canvas while the right button is down 
and
    only releases it once the menu detect event has returned. The context dialog
    runs its event loop inside that event, so the canvas kept the mouse and the
    dialog never received the mouse moves.
    
    The pipeline and workflow graphs now release the capture before opening the
    dialog.
---
 .../hop/ui/hopgui/file/pipeline/HopGuiPipelineGraph.java    | 13 +++++++++++++
 .../hop/ui/hopgui/file/workflow/HopGuiWorkflowGraph.java    | 13 +++++++++++++
 2 files changed, 26 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 15da8ee697..c0ad7b390b 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
@@ -1968,9 +1968,22 @@ public class HopGuiPipelineGraph extends 
HopGuiAbstractGraph
 
     CanvasTarget target = targetUnder(getVisibleAreaOwner(real.x, real.y), 
real);
     selectAsClicked(target);
+    releaseMouseCapture();
     openContextDialog(target, real, canvasPoint.x, canvasPoint.y);
   }
 
+  /**
+   * On Windows the canvas captures the mouse while the right button is down 
and only lets go once
+   * the menu detect event has returned. The context dialog runs its event 
loop inside that event,
+   * so without this the canvas keeps the mouse and the dialog never sees it 
move (issue #8760). Hop
+   * Web has no mouse capture.
+   */
+  private void releaseMouseCapture() {
+    if (!EnvironmentUtils.getInstance().isWeb()) {
+      canvas.setCapture(false);
+    }
+  }
+
   /**
    * What is under the pointer. A badge counts as what it belongs to: a hop 
badge as the hop, a
    * transform badge as the transform.
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 30e870f97b..83ec0173da 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
@@ -1538,9 +1538,22 @@ public class HopGuiWorkflowGraph extends 
HopGuiAbstractGraph
 
     CanvasTarget target = targetUnder(getVisibleAreaOwner(real.x, real.y), 
real);
     selectAsClicked(target);
+    releaseMouseCapture();
     openContextDialog(target, real, canvasPoint.x, canvasPoint.y);
   }
 
+  /**
+   * On Windows the canvas captures the mouse while the right button is down 
and only lets go once
+   * the menu detect event has returned. The context dialog runs its event 
loop inside that event,
+   * so without this the canvas keeps the mouse and the dialog never sees it 
move (issue #8760). Hop
+   * Web has no mouse capture.
+   */
+  private void releaseMouseCapture() {
+    if (!EnvironmentUtils.getInstance().isWeb()) {
+      canvas.setCapture(false);
+    }
+  }
+
   /**
    * What is under the pointer. A badge counts as what it belongs to: a hop 
badge as the hop, an
    * action badge as the action.

Reply via email to