RFR: 8357584: [XWayland] [OL10] Robot.mousePress() is delivered to wrong place
Alexander Zvegintsev
azvegint at openjdk.org
Wed Jun 18 15:39:16 UTC 2025
This changeset introduces an adapted version of [the OpenJDK fix](https://github.com/openjdk/jdk/commit/2dfbf41d2a3dbcd44f9ed9a58a1b0932d7536977) for mouse and keyboard interactions with Robot.
More info about the issue itself is available in the PR [description](https://github.com/openjdk/jdk/pull/25265#issue-3068640753)
In short, the currently used XTest for keyboard and mouse interactions may not be suitable for automated testing at some point, as it may require user confirmation to control the mouse or keyboard from time to time.
This fix adds support for the [Remote Desktop XDG portal](https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.RemoteDesktop.html).
This allows us to control the keyboard and mouse with Robot on Wayland, even outside the XWayland server (e.g., clicking on window headers and Wayland native apps).
----
* The remote desktop for Robot is enabled by default on GnomeShell 47+
* It can be enabled manually by setting the `javafx.robot.screenshotMethod` system property to `dbusRemoteDesktop` (e.g. it works on Ubuntu 24.04 with GnomeShell 46)
* The key handling might still have bugs.
* The main goal is to add this new functionality. If there are small issues that can't be solved right away, I will prefer to fix them in follow up fixes.
-------------
Commit messages:
- 8357584: [XWayland] [OL10] Robot.mousePress() is delivered to wrong place
Changes: https://git.openjdk.org/jfx/pull/1834/files
Webrev: https://webrevs.openjdk.org/?repo=jfx&pr=1834&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8357584
Stats: 1312 lines in 12 files changed: 1081 ins; 139 del; 92 mod
Patch: https://git.openjdk.org/jfx/pull/1834.diff
Fetch: git fetch https://git.openjdk.org/jfx.git pull/1834/head:pull/1834
PR: https://git.openjdk.org/jfx/pull/1834
More information about the openjfx-dev
mailing list