JDK-8165762 : javafx.scene.control.Tooltip.setConsumeAutoHidingEvents not working on Linux
  • Type: Bug
  • Component: javafx
  • Sub-Component: controls
  • Affected Version: 8u101
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: linux
  • CPU: x86_64
  • Submitted: 2016-09-06
  • Updated: 2018-09-05
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
tbdUnresolved
Description
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 ----------