Workarounds for apps that don't support HiDPI

hidpi

#1

Having just got a 4K monitor, wow! Text looks so much clearer! :open_mouth: Unfortunately, there are some applications that do not scale so they appear really tiny. This topic is to offer workarounds to get applications to work. This assumes you are comfortable with the terminal.

To make changes persistent, edit the application’s .desktop file or use the Main Menu tool to modify the command line.

Tips

  • If it’s a GTK+ based application, check to see if it has a GTK3 build.
  • GTK2 applications have no chance of scaling by themselves, i.e. GIMP, Inkscape, etc.
  • Some apps like Qt-based ones can be scaled by figuring which environment variables they use.
  • To tell what the toolkit of an application is, take a look at its dependencies (i.e. apt-cache show <package>)

“Tell me how to enable HiDPI for the MATE Desktop!”

Starting from 18.04, you’ll be able to turn on HiDPI from MATE Tweak.

What is discussed here can also apply to other distributions - such as Arch, where MATE is the desktop environment.


Any application

I came across a project which can scale anything by spawning a new session using X.org, the display server. It’s a clever trick as it will scale any application.

Although, it can appear or feel a little blurry to the rest of the desktop (that may or may not be physiological). :dizzy_face:

Instructions
  1. Download the run_scaled.sh script.

  2. Install its dependencies and move the script system-wide:

     chmod +x run_scaled.sh
     sudo mv ./run_scaled.sh /usr/bin/run_scaled
     sudo apt install xvfb xpra xrandr
    
  3. To use, simply prepend run_scaled to your command. There are optional parameters to specify scale.

     run_scaled <application>
    

One downside is that if it’s an audio player, the media keys will not work. Themes / mouse pointers can also be inconsistent.

Spotify

Spotify doesn’t auto-detect scaling properly, but fear not, you can manually specify this.

spotify --force-device-scale-factor=2

Geany

The version provided in the Ubuntu repository is built with GTK2. This PPA provides a version built with GTK3:

sudo add-apt-repository ppa:bluesabre/geany-gtk3
sudo apt update
sudo apt install geany-gtk3 geany-gtk3-plugins

Steam

Update to the beta version of the Steam client, as this supports HiDPI as of 25th January 2018.

Qt Applications

Such as VirtualBox, Git Cola and KeePassXC.

QT_SCREEN_SCALE_FACTORS=2 <application>

Known applications with no “proper” solutions

  • GIMP (GTK2)
  • Inkscape (GTK2)
  • Banshee (GTK2 / Mono) - 2.9.0 is GTK3, but isn’t stable
  • Audacity (GTK2)
  • Bleachbit (GTK2)
  • FileZila (GTK2)
  • PlayOnLinux
  • Wine

HiDPI support in 18.04 for MATE?
#2

This might be helpful for Java apps: https://askubuntu.com/questions/526484/fix-scaling-of-java-based-applications-for-a-high-dpi-screen