FULL PRODUCT VERSION :
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Linux hostname 3.13.0-48-generic #80-Ubuntu SMP Thu Mar 12 11:16:15 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
A DESCRIPTION OF THE PROBLEM :
I'm using a Tooltip in a cross-platform application. I want the tooltip to be auto-closed and also to not consume the auto-hiding events.
On Windows when clicking outside the tooltip the clicks seem to act as if the tooltip was not present.
On Linux the clicks get consumed in some cases, for example when trying to drag a window or clicking outside the parent window of the tooltip.
When trying to drag a window the first click gets consumed so I have to start dragging a second time. Trying to click a button in another window gives similar results - I have to click twice to activate the button. Clicking another button in the same window does work.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create a tooltip (javafx.scene.control.Tooltip).
Call tooltip.setAutoHide(true).
Call tooltip.setConsumeAutoHidingEvents(false).
Call tooltip.show(...).
Run the application, open the tooltip, then try to drag the window.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The tooltip should not consume auto hiding events, and it should be possible to drag the window after a tooltip is shown.
ACTUAL -
The tooltip consumes auto hiding events when those events are not sent to the content of the parent window. For example, it is not possible to drag the parent window of the tooltip on the first try.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
package openjdkbug;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Tooltip;
import javafx.scene.layout.Pane;
import javafx.stage.PopupWindow;
import javafx.stage.Stage;
public class TooltipTest extends Application {
public static void main(String[] args) {
launch();
}
@Override public void start(final Stage stage) throws Exception {
Tooltip tooltip = new Tooltip();
tooltip.setAnchorLocation(PopupWindow.AnchorLocation.CONTENT_TOP_LEFT);
tooltip.setText("This prevents dragging the window.");
tooltip.setAutoHide(true);
tooltip.setConsumeAutoHidingEvents(false);
Button button = new Button("1. Show Tooltip");
button.setOnAction(event -> tooltip.show(stage.getScene().getWindow()));
Pane pane = new Pane();
pane.getChildren().add(button);
stage.setTitle("2. Drag me");
stage.setWidth(200);
stage.setHeight(200);
stage.setScene(new Scene(pane));
stage.show();
}
}
---------- END SOURCE ----------