Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not firing event to DockPane #36

Open
lovky opened this issue Jul 3, 2018 · 1 comment
Open

Not firing event to DockPane #36

lovky opened this issue Jul 3, 2018 · 1 comment

Comments

@lovky
Copy link

lovky commented Jul 3, 2018

Hello,
I found (maybe) bug with deleting Node with DockPane. For example if you got Tab with DockPane and you close it in next tabs there will be NullPointException in DockTitleBar -> pickEventTarget() -> DockPane.dockpanes. Its because dockpane is no more in scene.
I tried to delete dockPane from DockPane.dockpanes, exception disapere but there is no more event in existing dockpanes.
And also I would ask you where do you fire event to dockPane ?

EDIT:
Magicly when I dock null to dockPane, events start firing.

EDIT 2:
Problem was in TabPane listener and not in DockPane listener. If something similiar happends to you just remove TabPane listener, add tabs with DockPane and then add listener to TabPane.

@RobertBColton
Copy link
Owner

RobertBColton commented Jul 5, 2018

This is partly a regression caused by 8d44134

The custom dock events are fired here:

private void pickEventTarget(Point2D location, EventTask eventTask, Event explicit) {

This is a bit of a tricky problem that I still haven't managed to figure out a good way around. In order to show the indicators and know when you are docking, the dock title bar has to forward my custom dock events to nodes that are behind it. Basically, I have to do my own scene graph traversal because JavaFX does not provide any that is considered public API. They deprecated StageHelper in Java 9, which I was using to get a list of all stages. That prompted me to maintain a static list of all DockPanes that have been created.

As you can see, that list is what is now causing your problem, you remove the DockPane and it's not removed from that list. There are multiple ways I could continue to hack around this, but at this point, I'd like to come up with a more permanent solution. I could have originally gone with using the clipboard preview, but I wanted dragging of a full blown window in DockFX like Visual Studio and Qt Framework. I'm open to ideas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants