-
Bug
-
Resolution: Unresolved
-
P4
-
8, 9, 10
-
generic
-
linux
FULL PRODUCT VERSION :
Java (TM) SE Runtime Environment (build 1.8.0_162-b12)
Java HotSpot (TM) 64-bit Server VM (build 25.162-b12, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
(CentOS 7) 3.10.0-693.el7.x86_64 #1 SMR Tue Aug 22 21:09:27 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
A DESCRIPTION OF THE PROBLEM :
On Linux, when pressing and dragging a JavaFX node using the physical mouse, mouseDragged and mouseReleased events still come to the application layer even if dragging and releasing outside of the Node's bounds. But when pressing and dragging using a touch gesture (finger on glass), the touchMoved and touchReleased events stop coming to the application layer as soon as the finger is dragged outside of the Node's bounds.
The physical mouse events work correctly on Linux, and both physical and touch events work correctly on Windows 7 and 10. This problem appears to be unique to Linux + touch.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create a simple JavaFX application that logs a Node's mouse and touch events to System.out. Observe that mouseDragged and mouseReleased events follow the physical mouse exactly, whether still inside the Node's bounds or not, while touchMoved events stop coming to the application and a touchReleased event is never fired if dragged and/or released outside the Node's bounds.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Expected result is for touch events to continue reporting to the application layer, even if the coordinates are outside the Node's bounds, consistent with the physical mouse events and consistent with what applications should reasonably expect from the event reporting framework.
ACTUAL -
Actual result is, touchMoved and touchReleased events are not reported to the application when the dragged or released coordinate is outside the Node's bounds.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
// Observe the different event reporting behavior between physical mouse and touch when dragging and/or releasing outside the bounds of 'button':
public void start(Stage primaryStage) {
Button button = new Button();
button.setText("Drag Me!");
button.setOnMousePressed(e -> { System.out.println("mousePressed"); });
button.setOnMouseDragged(e -> { System.out.println("mouseDragged"); });
button.setOnMouseReleased(e -> { System.out.println("mouseReleased"); });
button.setOnTouchPressed(e -> { System.out.println("touchPressed"); });
button.setOnTouchMoved(e -> { System.out.println("touchMoved"); });
button.setOnTouchReleased(e -> { System.out.println("touchReleased"); });
StackPane rootPane = new StackPane();
rootPane.getChildren().add(button);
primaryStage.setScene(new Scene(rootPane, 300, 250));
primaryStage.show();
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
I know of no work-around at this time, other than requiring my Linux users to use a physical mouse instead of the touch screen.
Java (TM) SE Runtime Environment (build 1.8.0_162-b12)
Java HotSpot (TM) 64-bit Server VM (build 25.162-b12, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
(CentOS 7) 3.10.0-693.el7.x86_64 #1 SMR Tue Aug 22 21:09:27 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
A DESCRIPTION OF THE PROBLEM :
On Linux, when pressing and dragging a JavaFX node using the physical mouse, mouseDragged and mouseReleased events still come to the application layer even if dragging and releasing outside of the Node's bounds. But when pressing and dragging using a touch gesture (finger on glass), the touchMoved and touchReleased events stop coming to the application layer as soon as the finger is dragged outside of the Node's bounds.
The physical mouse events work correctly on Linux, and both physical and touch events work correctly on Windows 7 and 10. This problem appears to be unique to Linux + touch.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create a simple JavaFX application that logs a Node's mouse and touch events to System.out. Observe that mouseDragged and mouseReleased events follow the physical mouse exactly, whether still inside the Node's bounds or not, while touchMoved events stop coming to the application and a touchReleased event is never fired if dragged and/or released outside the Node's bounds.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Expected result is for touch events to continue reporting to the application layer, even if the coordinates are outside the Node's bounds, consistent with the physical mouse events and consistent with what applications should reasonably expect from the event reporting framework.
ACTUAL -
Actual result is, touchMoved and touchReleased events are not reported to the application when the dragged or released coordinate is outside the Node's bounds.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
// Observe the different event reporting behavior between physical mouse and touch when dragging and/or releasing outside the bounds of 'button':
public void start(Stage primaryStage) {
Button button = new Button();
button.setText("Drag Me!");
button.setOnMousePressed(e -> { System.out.println("mousePressed"); });
button.setOnMouseDragged(e -> { System.out.println("mouseDragged"); });
button.setOnMouseReleased(e -> { System.out.println("mouseReleased"); });
button.setOnTouchPressed(e -> { System.out.println("touchPressed"); });
button.setOnTouchMoved(e -> { System.out.println("touchMoved"); });
button.setOnTouchReleased(e -> { System.out.println("touchReleased"); });
StackPane rootPane = new StackPane();
rootPane.getChildren().add(button);
primaryStage.setScene(new Scene(rootPane, 300, 250));
primaryStage.show();
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
I know of no work-around at this time, other than requiring my Linux users to use a physical mouse instead of the touch screen.
- duplicates
-
JDK-8202023 No "touch-triggered" ScrollEvents in dialogs on linux systems
-
- Closed
-
- relates to
-
JDK-8090954 Gtk: Linux multi-touch support
-
- Open
-