Table of Contents |
---|
External - system-side update/fix required, can't be fixed/resolved on the JDK side without it.
Specification change
involvedrelated:
- [Spec][X11 compatibility]: Robot.mouseMove does not visually move mouse cursor
- [Spec][X11 compatibility]: XTest emulated mouse click does not bring window to front.
- [Spec][X11 compatibility]: Click on title to request focus test failures
- [Spec][X11 compatibility][Pure Wayland]: java.awt.Robot taking screenshots
- [Spec][X11 compatibility]: Popup menu dismiss in X11 compatibility mode.
Unresolved:
Anchor | ||||
---|---|---|---|---|
|
Problem: | Cannot emulating keyboard/mouse events on Pure Wayland at all, in X11 compatibility mode only inside X11 server |
Tags: | Pure Wayland(External), X11(can be used with limitations) |
Related links: | [X11 compatibility]: Robot.mouseMove does not visually move mouse cursor [X11 compatibility]: XTest emulated mouse click does not bring window to front.. [X11 compatibility]: Click on title to request focus test failures |
Discussion: | The java.awt.Robot class provides methods to emulate input; keyPress(), keyRelease(), mousePress(), mouseRelease() Current robot implementation doesn't work for Pure Wayland port at all, but it mostly works for X11 compatibility mode. However, there are some cases when it fails for X11 - when trying to reach outside XWayland server with using XTest API: JDK-8280995 X11 compatibility: Robot.mouseMove does not visually move mouse cursor JDK-8280990 X11 compatibility: XTest emulated mouse click does not bring window to front. JDK-8280988 X11 compatibility: Click on title to request focus test failures Implementing this via libEI will also fix the above issues |
Solution: | X11: Can be used in X11 compatibility mode with the above-mentioned limitations, otherwise we'll have to use the same options as for Pure Wayland. Covered by documentation changes in JDK-8307779 Relax the java.awt.Robot specification Pure Wayland: Solution #1. Not yet usable This will probably be implemented by libEI. However, its shipping time(even estimated) is not yet known. Solution #2. Not yet usable You can do most of this using the RemoteDesktop portal. Once permission is given, you can use it to completely control the keyboard and mouse. However, you can't keep the permission as you can with |
Workaround: |
Anchor | ||||
---|---|---|---|---|
|
Problem: | Unable to control the position of the splash screen (e.g., display it in the center of the screen) |
Tags: | Pure Wayland(external) |
Related links: | wayland/wayland-protocols/-/issues/67 |
Discussion: | The native Wayland splash screen window usually appears somewhere in the upper left corner of the screen. This is due to Wayland not allowing windows to position themselves. This will need a Wayland protocol extension to add a role for an output-only, centered surface. it'd just need a fallback implementation for compositors that doesn't support it, e.g. a dialog Add input to this existing issue : wayland/wayland-protocols/-/issues/67 Implementation will probably be similar to this MR for Picture-In-Picture video: wayland/wayland-protocols/-/merge_requests/132 |
Solution: | None yet (see discussion in the GitLab issue). |
Workaround: | use X11 if available |
Anchor | ||||
---|---|---|---|---|
|
Problem: | Applications running on XWayland looks blurry on HiDPI screens |
Tags: | X11(external/internal?) |
Related links: | xserver/-/issues/1318, GNOME/mutter/-/issues/402 |
Discussion: | Quote from Maxim Kartashev's e-mail:
|
Solution: | wakefield-dev/2023-February/000081.html |
Workaround: |
Anchor | ||||
---|---|---|---|---|
|
[X11 compatibility]: XTest emulated mouse click does not bring window to front.
Problem: | window does not come to front on emulated mouse click. Window focus transfer happens without issues. | |||||||||||
Tags: | X11(spec change) | |||||||||||
Related links: | [External][Pure Wayland][X11 compatibility]: java.awt.Robot emulating keyboard/mouse events | |||||||||||
Discussion: |
| |||||||||||
Solution: | Use the same solution as for the Pure Wayland toolkit Preferred: emulate mouse click with libei | |||||||||||
Workaround: | modify tests to use another API to bring window to front (e.g XMapRaised) Covered by documentation changes in JDK-8307779 Relax the java.awt.Robot specification. Test modifications are still needed. |
Anchor | ||||
---|---|---|---|---|
|
[X11 compatibility]: Click on title to request focus test failures
Problem: | Some tests are trying to get focus of a window by clicking on its title bar. |
Tags: | X11(spec change) |
Related issues: | [External][Pure Wayland][X11 compatibility]: java.awt.Robot emulating keyboard/mouse events |
Discussion: | |
Solution: | Use the same solution as for the Pure Wayland toolkit |
Workaround: | Click on window's body instead of decorations, request focus in other way Covered by documentation changes in JDK-8307779 Relax the java.awt.Robot specification. Test modifications are still needed. |
Anchor | ||||
---|---|---|---|---|
|
Problem: | window is not rendered correctly(wrong colors) using setXORMode in Virtual Box with 3D acceleration enabled. |
Tags: | X11(external) |
Related links: | xorg/xserver/-/issues/1333 → mesa/mesa/-/issues/6596 |
Discussion: | |
Solution: | None, waiting for external fix |
Workaround: |
Anchor | ||||
---|---|---|---|---|
|
Problem: | GUI are crashing if you are trying to map a lot( > ~260) of windows at once. |
Tags: | X11(external) |
Related links: | xorg/xserver/-/issues/1222. |
Discussion: |
It may be faced when running some tests which are trying to map a lot of windows, e.g. one for every GraphicsConfiguration. If you have 210 GraphicsConfigurations per display on Xwayland, then running such test in 2 display configuration will lead to crash. |
Solution: | None (yet) |
Workaround: | Fix the failing test, e.g. by adding some delay after each ~100 windows displayed |
Fix in progress:
Fixed:
Anchor | ||||
---|---|---|---|---|
|
[X11 compatibility][Pure Wayland]: java.awt.Robot taking screenshots
Problem: | The java.awt.Robot class provides createScreenCapture() method which currently uses X11-specific APIs |
Tags: | X11, Pure Wayland, spec change |
Related links: | |
Discussion: | It is doable as of now, but not in a standard and convenient way. It can be done using some shell specific APIs, e.g. org.gnome.Shell.Screenshot DBUS API (which will not work for KDE, it has another API) It has several drawbacks:
So, it would be great to get some standard API to get screenshot data in memory. I see that there is an open bug against this issue. Specification change needed to handle user confirmation of screen capture (user can deny/partially allow screen capture). |
Solution: | Solution #1. Specifically, it provides org.freedesktop.portal.Screenshot#Screenshot which can be used to create a screenshot. However, it has some drawbacks(at least on Gnome):
There is also org.freedesktop.portal.Screenshot#PickColor API which can't be used for Robot#getPixelColor needs. It does not allow to take a pixel color at specified location, but interactively asks a user to pick a color with mouse cursor. Solution #2. Preferred Finally, another possibility is to use the Screencast portal. This might be a bit of overkill, but it avoids several of the problems mentioned in the screenshot and color picker portals.
Each solution is viable, but #2 seems to be more preferable. However we may want to implement both of approaches: If some new display got or disconnected, new permission request from user is required. In case of automated testing it may be a stopper. But we can fallback to a solution #1. Prototype is available here.
CSR Approved JDK-8307456 Review in process: openjdk/jdk/pull/13803 |
Workaround: |
AnchordistroAvailability distroAvailability
Testing on latest supported Linux distros for JDK19
distroAvailability | |
distroAvailability |
Packages required for permission restoration:
- xdg-desktop-portal 1.12+
- xdg-desktop-portal-gnome 42+ (it is a backend for xdg-desktop-portal)
However xdg-desktop-portal-gnome package is installed only for Ubuntu and SLES, OEL9 and RHEL9 does not have it yet.
works? | xdg-desktop-portal | xdg-desktop-portal-gnome | Gnome | ||
---|---|---|---|---|---|
Ubuntu 22.04 | Yes | 1.14.4-1 | 42.1 | 42.2 | |
OEL9 | Partially | 1.12.1-1 | missing | 40.4.0 | persist_mode and restore_token has no effect |
RHEL9 | Partially | 1.12.1-1 | missing | 40.4.0 | persist_mode and restore_token has no effect |
SLES15 | Partially | 1.10.1 | 41.1 | 41.2 | protocol version 3 (1.10 < 1.12), restore_token is not supported |
Where partially means that you can make a screenshot, however it requires user permission on each request.
Anchor | ||||
---|---|---|---|---|
|
Problem: | Drag and drop from java to Wayland apps does not work with current JDK implementation. |
Tags: | X11(external) |
Related links: | GNOME/mutter/-/issues/2042, GNOME/mutter/-/merge_requests/2124 |
Discussion: | JDK code it quite picky for the drop target, and requires it to be a toplevel with WM_STATE property, whereas the Wayland server uses dummy windows without this property set. We need to disable this behaviour when the Wayland session is active. |
Solution: | external fix released, fix on JDK side targeted for 21 |
Workaround: |
Anchor | ||||
---|---|---|---|---|
|
[X11 compatibility]: Robot.mouseMove does not visually move mouse cursor
Problem: | Robot.mouseMove does not visually move mouse cursor |
Tags: | X11(spec change) |
Related links: | [External][Pure Wayland][X11 compatibility]: java.awt.Robot emulating keyboard/mouse events |
Discussion: | Javadoc for
Despite the fact that this mouse movement is successfully emulated within the XWayland server(following mouse press emulation will be in a right place), the mouse cursor does not visually move. With current specification of |
Solution: | Use the same solution as for the Pure Wayland toolkit Preferred: see earlier point on working with RemoteDesktop portal(can't keep the user permission between sessions) JDK21: Covered by JDK-8307779 Relax the java.awt.Robot specification |
Workaround: | Change the documentation to reflect the current behavior |
Anchor | ||||
---|---|---|---|---|
|
[X11 compatibility]: Popup menu dismiss in X11 compatibility mode.
Problem: | We are using XGrabPointer to get mouse input and dismiss popup menus on mouse click. Obviously, it does not work outside of XWayland server. | |||||
Tags: | X11, spec change | |||||
Related links: | ||||||
Discussion: | E.g. if we have shown some popup menu, it will be closed upon clicking on any of XWayland's windows. But it will not be closed if we click on some other window from Wayland.
For a first look this workaround seems to work reliably except only one case: clicking on window's title containing origin component does not lead to focus change, thus we don't hiding a popup.
| |||||
Solution: | Use workaround. This also requires a change in documentation, as there are "blind spots" which, if clicked on, will not close the popup window(e.g. window title or area in the side dock without application icons) Fixed in JDK21 | |||||
Workaround: | Dismiss menu on window focus lost event(Seems to be a common workaround, third party X11 applications already use it)) |
Anchor | ||||
---|---|---|---|---|
|
Problem: | System session crashes when trying to display a huge window |
Tags: | X11(external) |
Related links: | xorg/xserver/-/merge_requests/754, wayland/wayland/-/merge_requests/179 |
Discussion: | // gcc hugeFrame.c -o hugeFrame -lX11 && ./hugeFrame #include <X11/Xlib.h> #include <unistd.h> static Display* display; int main(void) { int width = 22000; int height = 25000; display = XOpenDisplay(NULL); Window win = XCreateSimpleWindow(display, DefaultRootWindow(display), 0, 0, width, height, 0, 0L, 0L); XMapWindow(display, win); XFlush(display); sleep(1); }
where -2094967296 looks like an integer overflow of 4 * 22000 * 25000 So it fails to create a pool, but doesn't handle it gracefully. |
Solution: | external fix released |
Workaround: |
Anchor | ||||
---|---|---|---|---|
|
Problem: | Can't perform a Drag and Drop operation from X11 client to a Wayland client if there is an intermediate window during the drag. |
Affected: | X11(external) |
Related links: | GNOME/mutter/-/issues/2136 |
Discussion: | |
Solution: | external fix released |
Workaround: |
Anchor | ||||
---|---|---|---|---|
|
Problem: | Custom cursor(e.g. loaded from GIF) set by Component#setCursor might be displayed in wrong color. |
Tags: | X11(external) |
Related links: | /xorg/xserver/-/issues/1303, MR |
Discussion: | For example on following screenshot X shaped cursor should be displayed in yellow: Reported as /xorg/xserver/-/issues/1303 |
Solution: | external fix released |
Workaround: |
Anchor | ||||
---|---|---|---|---|
|
Problem: | We are not getting updates from the system after "changing" screen resolution via XRRSetScreenConfigAndRate . |
Tags: | X11 (external) |
Related links: | xorg/xserver/-/merge_requests/731, xorg/xserver/-/issues/1305 |
Discussion: | Excerpt from Olivier's mail:
This notification would be helpful. This MR adds notification, however it has several issues:
|
Solution: | external fix released |
Workaround: |