When dragging a Dockable usually you grab the title. So the source
of the MouseEvents
should be something like AbstractMultiDockTitle$1
, or some other child-Component of the title.
Both the ActionPopup and the DefaultDockRelactor have a MouseListener added to the title, so it’s perfectly fine and expected that both these classes receive the mouse-released event.
The DefaultSplitDividerStrategy globally listens to all AWTEvents. It is also correct that it gets the MouseEvent.
If you would like to continue debugging (I would appreciate that), then I think as next step you should add a global AWTListener, and analyze the MouseEvents:
public void eventDispatched( AWTEvent event ) {
System.out.println(event);
}
}, AWTEvent.MOUSE_MOTION_EVENT_MASK | AWTEvent.MOUSE_EVENT_MASK );```
The output of this code should be something like this:
java.awt.event.MouseEvent[MOUSE_MOVED,(537,8),absolute(601,506),button=0,clickCount=0] on bibliothek.gui.dock.title.AbstractMultiDockTitle$1[,17,0,746x22,layout=java.awt.FlowLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777217,maximumSize=,minimumSize=,preferredSize=]
*** java.awt.event.MouseEvent[MOUSE_PRESSED,(537,8),absolute(601,506),button=1,modifiers=Button1,extModifiers=Button1,clickCount=1] on bibliothek.gui.dock.title.AbstractMultiDockTitle$1[,17,0,746x22,layout=java.awt.FlowLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777217,maximumSize=,minimumSize=,preferredSize=]
java.awt.event.MouseEvent[MOUSE_DRAGGED,(536,8),absolute(600,506),button=0,modifiers=Button1,extModifiers=Button1,clickCount=0] on bibliothek.gui.dock.title.AbstractMultiDockTitle$1[,17,0,746x22,layout=java.awt.FlowLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777217,maximumSize=,minimumSize=,preferredSize=]
java.awt.event.MouseEvent[MOUSE_DRAGGED,(536,7),absolute(600,505),button=0,modifiers=Button1,extModifiers=Button1,clickCount=0] on bibliothek.gui.dock.title.AbstractMultiDockTitle$1[,17,0,746x22,layout=java.awt.FlowLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777217,maximumSize=,minimumSize=,preferredSize=]
java.awt.event.MouseEvent[MOUSE_DRAGGED,(536,6),absolute(600,504),button=0,modifiers=Button1,extModifiers=Button1,clickCount=0] on bibliothek.gui.dock.title.AbstractMultiDockTitle$1[,17,0,746x22,layout=java.awt.FlowLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777217,maximumSize=,minimumSize=,preferredSize=]
[…]
java.awt.event.MouseEvent[MOUSE_DRAGGED,(539,-6),absolute(603,492),button=0,modifiers=Button1,extModifiers=Button1,clickCount=0] on bibliothek.gui.dock.title.AbstractMultiDockTitle$1[,17,0,746x22,layout=java.awt.FlowLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777217,maximumSize=,minimumSize=,preferredSize=]
java.awt.event.MouseEvent[MOUSE_DRAGGED,(539,-7),absolute(603,491),button=0,modifiers=Button1,extModifiers=Button1,clickCount=0] on bibliothek.gui.dock.title.AbstractMultiDockTitle$1[,17,0,746x22,layout=java.awt.FlowLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777217,maximumSize=,minimumSize=,preferredSize=]
java.awt.event.MouseEvent[MOUSE_DRAGGED,(540,-8),absolute(604,490),button=0,modifiers=Button1,extModifiers=Button1,clickCount=0] on bibliothek.gui.dock.title.AbstractMultiDockTitle$1[,17,0,746x22,layout=java.awt.FlowLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777217,maximumSize=,minimumSize=,preferredSize=]
java.awt.event.MouseEvent[MOUSE_EXITED,(559,420),absolute(604,489),button=0,modifiers=Button1,extModifiers=Button1,clickCount=0] on bibliothek.gui.dock.SplitDockStation$Content[,0,0,790x566,layout=java.awt.FlowLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777217,maximumSize=,minimumSize=,preferredSize=]
java.awt.event.MouseEvent[MOUSE_ENTERED,(557,396),absolute(604,489),button=0,modifiers=Button1,extModifiers=Button1,clickCount=0] on bibliothek.gui.dock.util.ConfiguredBackgroundPanel[,0,22,786x397,layout=java.awt.BorderLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777225,maximumSize=,minimumSize=,preferredSize=]
java.awt.event.MouseEvent[MOUSE_DRAGGED,(540,-9),absolute(604,489),button=0,modifiers=Button1,extModifiers=Button1,clickCount=0] on bibliothek.gui.dock.title.AbstractMultiDockTitle$1[,17,0,746x22,layout=java.awt.FlowLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777217,maximumSize=,minimumSize=,preferredSize=]
[…]
java.awt.event.MouseEvent[MOUSE_DRAGGED,(629,-174),absolute(693,324),button=0,modifiers=Button1,extModifiers=Button1,clickCount=0] on bibliothek.gui.dock.title.AbstractMultiDockTitle$1[,17,0,746x22,layout=java.awt.FlowLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777217,maximumSize=,minimumSize=,preferredSize=]
java.awt.event.MouseEvent[MOUSE_DRAGGED,(630,-174),absolute(694,324),button=0,modifiers=Button1,extModifiers=Button1,clickCount=0] on bibliothek.gui.dock.title.AbstractMultiDockTitle$1[,17,0,746x22,layout=java.awt.FlowLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777217,maximumSize=,minimumSize=,preferredSize=]
java.awt.event.MouseEvent[MOUSE_EXITED,(647,231),absolute(694,324),button=1,modifiers=Button1,extModifiers=Button1,clickCount=0] on bibliothek.gui.dock.util.ConfiguredBackgroundPanel[,0,22,645x397,layout=java.awt.BorderLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777225,maximumSize=,minimumSize=,preferredSize=]
java.awt.event.MouseEvent[MOUSE_ENTERED,(649,255),absolute(694,324),button=1,modifiers=Button1,extModifiers=Button1,clickCount=0] on bibliothek.gui.dock.SplitDockStation$Content[,0,0,790x566,layout=java.awt.FlowLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777217,maximumSize=,minimumSize=,preferredSize=]
*** java.awt.event.MouseEvent[MOUSE_RELEASED,(630,-174),absolute(694,324),button=1,modifiers=Button1,clickCount=0] on bibliothek.gui.dock.title.AbstractMultiDockTitle$1[,17,0,746x22,layout=java.awt.FlowLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777217,maximumSize=,minimumSize=,preferredSize=]
java.awt.event.MouseEvent[MOUSE_MOVED,(651,257),absolute(696,326),button=0,clickCount=0] on bibliothek.gui.dock.SplitDockStation$Content[,0,0,790x566,layout=java.awt.FlowLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777217,maximumSize=,minimumSize=,preferredSize=]
java.awt.event.MouseEvent[MOUSE_EXITED,(655,267),absolute(700,336),button=0,clickCount=0] on bibliothek.gui.dock.SplitDockStation$Content[,0,0,790x566,layout=java.awt.FlowLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777217,maximumSize=,minimumSize=,preferredSize=]
java.awt.event.MouseEvent[MOUSE_ENTERED,(3,243),absolute(700,336),button=0,clickCount=0] on bibliothek.gui.dock.util.ConfiguredBackgroundPanel[,0,22,136x540,layout=java.awt.BorderLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777225,maximumSize=,minimumSize=,preferredSize=]
java.awt.event.MouseEvent[MOUSE_MOVED,(3,243),absolute(700,336),button=0,clickCount=0] on bibliothek.gui.dock.util.ConfiguredBackgroundPanel[,0,22,136x540,layout=java.awt.BorderLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777225,maximumSize=,minimumSize=,preferredSize=]
java.awt.event.MouseEvent[MOUSE_MOVED,(8,250),absolute(705,343),button=0,clickCount=0] on bibliothek.gui.dock.util.ConfiguredBackgroundPanel[,0,22,136x540,layout=java.awt.BorderLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777225,maximumSize=,minimumSize=,preferredSize=]
I marked the two events that are really interesting with "***" - the mousePressed and the mouseReleased-Event. They way you describe the bug I would suspect that these two MouseEvents do not match up. For example, do both events have the same source? If they do not match: then it is a bug in the JRE, and I cannot do anything against those. If it does match up... well then my guess was wrong and I do still not have a good idea.
There are some known bugs in the JDK regarding focus when new Windows are opened (google "java 6 focus bug"). This could be related, because the icon that shows up during a drag and drop operation is a Window as well.
By the way, you can disable the moving image:
// if you have only a DockController:
controller.getProperties().set( DockTheme.DOCKABLE_MOVING_IMAGE_FACTORY, new DockableMovingImageFactory() {
public MovingImage create( DockController controller, Dockable dockable ) {
// show no image
return null;
}
public MovingImage create( DockController controller, DockTitle snatched ) {
// show no image
return null;
}
});
// … or if using a CControl:
// CControl control = … ;
// control.putProperty( DockTheme.DOCKABLE_MOVING_IMAGE_FACTORY, new … );