<AWT Dev> AWT and X11 parameters

Ilia Pavlikhin owl at ow1.in
Fri Feb 7 09:12:31 UTC 2020


Hello.

We're found some strange behaviors in code with some X11 system 
parameters, such as:

1. Programmer doesn't have public methods for getting/setting WM_CLASS
https://github.com/AdoptOpenJDK/openjdk-jdk11u/blob/770ef496e67e318ea5418609b83cf0304761e210/src/java.desktop/unix/classes/sun/awt/X11/XToolkit.java#L170

2. Used one private variable twice to set WM_CLASS
https://github.com/AdoptOpenJDK/openjdk-jdk11u/blob/770ef496e67e318ea5418609b83cf0304761e210/src/java.desktop/unix/classes/sun/awt/X11/XRootWindow.java#L66

3. Used the WM_CLASS variable to set the window name, which is incorrect
https://github.com/AdoptOpenJDK/openjdk-jdk11u/blob/770ef496e67e318ea5418609b83cf0304761e210/src/java.desktop/unix/classes/sun/awt/X11/XRootWindow.java#L63

In X11 ideology WM_CLASS and WM_NAME variables are used for  different 
purposes.
First one - for technical determination what window is it (for example, 
some WMs like dwm, bspwm, etc use WM_CLASS to apply different window 
configuration settings - floating, desktop name, etc).
Second one is used to show the name of the  window  to user (taskbar 
popup, for example).

Also, parts of WM_CLASS should be different to determine the certain 
application and the part of application as the owner of current window. 
(For example WM_CLASS="Test","pop-up" defines window with type pop-up of 
Test application)

At this time WM_CLASS can be change only through reflection, but it's 
wrong, I think. Can you, please, create three interfaces for little bit 
clearly operating X11 window properties (two for WM_CLASS and one for 
WM_NAME).

---
Ar cieņu,
Digital Owl


More information about the awt-dev mailing list