JDK-8114061 : Pulse stops firing while dragging a SplitPane divider
  • Type: Bug
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: fx2.0
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2011-07-27
  • Updated: 2015-06-16
  • Resolved: 2011-08-02
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
fx2.0Fixed
Related Reports
Duplicate :  
Relates :  
Description
To reproduce. (You may need to do this several times to reproduce this bug.)
  1.  Click and drag the divider to the left or right
  2.  Click and drag the divider again in the opposite direction.

When the divider stops moving the bug is reproduced.  Notice the divider position is still being updated but the pulse stops firing.  The pulse will continue to fire after another mouse or window resize event.

========== test code ==========
import com.sun.javafx.tk.TKPulseListener;
import com.sun.javafx.tk.Toolkit;
import javafx.application.Application;
import javafx.scene.control.SplitPaneBuilder;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.SplitPane;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
import javafx.beans.InvalidationListener;
import javafx.beans.Observable;
import javafx.scene.layout.StackPaneBuilder;

public class RT15407 extends Application implements TKPulseListener {

    public static void main(String[] args) {
        launch(args);
    }

    public void start(Stage stage) {
        VBox list = new VBox(25);

        stage.setX(100);
        stage.setY(100);
        Scene scene = new Scene(list, 300, 300);
        stage.setScene(scene);
//        stage.setVisible(true);
        stage.show();

        final SplitPane pane = SplitPaneBuilder.create().items(
                StackPaneBuilder.create().children().alignment(Pos.CENTER).build(),
                StackPaneBuilder.create().children().alignment(Pos.CENTER).build()
                ).prefWidth(200).prefHeight(200).build();

        pane.getDividers().get(0).positionProperty().addListener(new InvalidationListener() {
            public void invalidated(Observable o) {
                System.out.println("DIVIDER POSITION " + o);
            }
        });

        list.getChildren().add(pane);
        Toolkit tk = Toolkit.getToolkit();
        tk.addSceneTkPulseListener(this);
    }

    public void pulse() {
        System.out.println("PULSE " + System.currentTimeMillis());
    }
}
------------------------------------








Comments
Verified with b42
30-08-2011

http://jfxsrc.us.oracle.com/javafx/presidio/scrum/graphics/runtime/rev/efd66ed135bf
02-08-2011

The root cause is a latent bug in the logic that detects whether we should fire an animation pulse (probably triggered by recent changes in the MouseEvent click generation, but that was just the catalyst). The basic problem is this: 1. We get a notification to run an animation pulse 2. If there is already an pulse in progress, we don't schedule another one 3. If we then get an incoming notification from the MasterTimer to shutdown animation before we get to the next timer interval, we will clear the animationRunning flag and miss the requested pulse. The fix is to latch the animationRunning flag to true when we should run an animation, and only set it to false once we actually schedule a pulse.
29-07-2011

http://beethoven.us.oracle.com/webrev/javafx/rt-15407/
29-07-2011

After following the steps more exactly (it is necessary to click-drag-release, then click-drag-release again) I can reproduce it. If there is other animation happening, then this bug does not occur. If I trigger an animation after, say, 10 seconds, and then trigger the bug, it starts responding again as soon as the animation starts up. My guess is that it is a scene graph bug, either in the handling of dirty bits or in mouse event generation, but I will verify.
29-07-2011

I cannot reproduce this on my system.
28-07-2011