Skip to content

Commit

Permalink
Fix RobertBColton#38, handling multiple panes in the context of event…
Browse files Browse the repository at this point in the history
… handlers.
  • Loading branch information
hkmoon committed Jun 24, 2019
1 parent 868ac6a commit af5f18c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/main/java/org/dockfx/DockNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -1124,6 +1124,11 @@ public Node getLastDockSibling()
return lastDockSibling;
}

private DockPane prevDockPane;

public DockPane getPrevDockPane() {
return prevDockPane;
}
/**
* Dock this node into a dock pane.
*
Expand Down Expand Up @@ -1163,6 +1168,7 @@ private final void dockImpl(DockPane dockPane)
{
setFloating(false);
}
this.prevDockPane = this.dockPane;
this.dockPane = dockPane;
this.dockedProperty.set(true);
this.closedProperty.set(false);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/dockfx/DockTitleBar.java
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ public void run(Node node, Node dragNode)
dragNodes.clear();

// Remove temporary event handler for bug mentioned above.
DockPane dockPane = this.getDockNode().getDockPane();
DockPane dockPane = this.getDockNode().getPrevDockPane();
if (dockPane != null)
{
dockPane.removeEventFilter(MouseEvent.MOUSE_DRAGGED, this);
Expand Down

0 comments on commit af5f18c

Please sign in to comment.