How to fix JetBrains IDE scaling issues on Wayland on HiDPI screens

Piotr Pliszko

If you use JetBrains IDEs like IntelliJ IDEA or WebStorm on a Linux desktop (such as KDE Plasma or GNOME) with HiDPI screens, you might have encountered scaling issues, especially if you use fractional scaling.

I work on three 4K 27" monitors, and unfortunately, I need to use 1.5x fractional scaling to have reasonably sized elements on the screen. Wayland provides great support for apps that use Wayland natively, but the problem appears when they try to use X11. Depending on your configuration, they may not be scaled at all, or be scaled but blurry.

For me, the issue appeared when I synced UI settings with macOS. Initially, everything worked fine on my KDE Plasma desktop, but after my MacBook synced some settings, all JetBrains IDEs on my desktop decided to stop scaling - and appeared very tiny. Clearing the cache and window configuration didn't help, so I started digging deeper.

After a quick investigation, it turned out that they were all running on X11 compatibility mode. Fortunately - JetBrains delivered proper support for Wayland! Let's enable it and fix the sync issues.

Forcing IDE to use the native Wayland toolkit

Prior to 2024.2 EAP, JetBrains IDEs on Linux were using the X11 protocol and an X server to show their user interface, even if running on a Wayland-based desktop. It was usually not a big issue, but was really problematic with fractional scaling that is not properly supported on X11.

Starting with this version, we can use the following parameter to explicitly enable Wayland support:

-Dawt.toolkit.name=WLToolkit

This bypass the XWayland compatibility layer and tells IDE to use Wayland directly.

Add this property to the VM Options - you can find them in

Help | Edit Custom VM Options...

Just add this line at the end of the file. Then, save and restart IDE.

Disabling UI sync to prevent recurring issues

JetBrains' Settings Sync feature syncs lots of various UI properties, including window geometry, scaling and keymaps across devices.

If you like me regularly use various machines and platforms (Linux and macOS machines have a different keyboard layout, and usually also different screens), then syncing UI settings often results in incorrect scaling, wrong keymaps or broken layouts.

To prevent these problems, go to Settings, then find Backup and Sync, and disable UI settings from the list.

You will lose few things synced but save yourself a lot of headaches.

Resources

If you have any questions or feedback, feel free to reach out to me on GitHub, X , Bluesky or LinkedIn!