Multi monitor HIDPI in X11 compatibility mode

Nikita Gubarkov nikita.gubarkov at
Thu Feb 2 22:47:40 UTC 2023

JetBrains Runtime has support for per-monitor scaling in X11 mode
implemented a few months ago.

At first I tried to use the GTK library for reading the scales as suggested
in, but in a multi-monitor
environment it is always returning scale of the main display when running
with X11 backend.
The final solution was to connect to Wayland just to read the scaling
values and then do a huge refactoring to make AWT's X11-related code
respect these individual scaling values.
For coordinate conversions I took the same approach that was used in
Windows -
There were some issues that I was unable to solve, like the window title
bar is always scaled with the main monitor's scale no matter what monitor
the window is on, the same with mouse cursor when it's over the window, but
overall it seems to work.

I can try porting this into OpenJDK and create a PR if needed.

JBR issue:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the wakefield-dev mailing list