JDK-8338752 : Wrong mouse position in popup menus when running in KDE Plasma 6.2-dev
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 21
  • Priority: P5
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux
  • CPU: x86_64
  • Submitted: 2024-08-21
  • Updated: 2024-08-26
  • Resolved: 2024-08-26
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
tbdResolved
Related Reports
Duplicate :  
Description
ADDITIONAL SYSTEM INFORMATION :
OS: Arch Linux
Desktop Environment: KDE Plasma 6.2 (dev build, not yet released)
JRE: 22.0.2.u9

A DESCRIPTION OF THE PROBLEM :
In the upcoming KDE Plasma 6.2 release, the window manager `kwin` has a change in when `ConfigureNotify` is sent:
https://invent.kde.org/plasma/kwin/-/commit/7b486e215d44bbd9fdeb8f1180c76fb16ec6a311

The above change conforms to ICCCM, but it breaks Java apps using Swing: after maximizing the app window, in popup menus, the app considers the mouse cursor to be at a different position than it visually is, as if the app window is in the position before maximizing.

We suspect this is caused by AWT special-casing `ConfigureNotify` behavior on a WM whitelist:
https://github.com/openjdk/jdk/blob/88ccbb60919e4523064b0da17184eedcd9efa087/src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java#L772
And `kwin` is not in the list. Making `kwin` disguise as `mutter` fixes the problem, which confirms the theory.

So can you remove the whitelist and make it "the default for every case" as in comments in the above code, or add `kwin` to the list?

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Start KDE Plasma 6.2-dev.
2. Start the Java app `jdownloader2`, unmaximized.
3. Move the app window to the screen center.
4. Maximize the app window.
5. Right click to show the popup menu.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Mouse works alright in the menu.
ACTUAL -
Mouse is considered to be to the top-left of its actual position.

FREQUENCY : always



Comments
unsupported config
21-08-2024