Workarounds for apps that don't support HiDPI

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
5 Likes

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

Thanks for the tips!

I use a few QT programs (KMyMoney, KeepassXC, and Manuskript). Another way to get them to scale involves general settings. I put two files in my home directory. I think only one of them is needed, but I don't know which one. Anyway, I didn't have either of them after a fresh install of Ubuntu MATE 18.04.2, so I made them.

The first is called ".profile" and the second, ".bash_profile" . And each contains the line:
export QT_AUTO_SCREEN_SCALE_FACTOR=1

When I rebooted, KMyMoney, KeepassXC, and Manuskript all were properly scaled. I guess it would work on other QT applications...?

Also, I do have some old Windows programs (three of which are 16-bit, and two are 32-bit). I went to a terminal and typed in:
winecfg

This opens the wine Configuration dialogue box. I went to the Graphics tab and tried setting Screen resolution dpi to 256. This worked okay for my text-and-window based 32-bit program, but it failed to do anything for my other 32-bit program, which was a graphics-heavy game. It also did nothing but screw up some of the text on the 16-bit programs, so I just set the dpi to 128 and left it. It's hardly a tragedy, as I almost never use those old Windows programs.

I wonder, though, if anyone out there knows what might make it possible to up-scale old Windows programs (like from the 16-bit era).