Small icons and application menus in displays with high DPI

My new laptop XPS 13 9370 is great but I can ran it with such high display resolution (3840 x 2160 pixel 331 PPI) that I have to run it with a scale factor of 2.12. But not all applications scale appropriately. For Gimp I could solve it using a theme with larger icons, but some old X11 applications like Xfig, which I've been using since my Unix times in the late 1980s and could never substitute by anything else, don't scale at all. This is a problem since the menus and icons, as well as line thickness and such, are so small and thin that Xfig becomes unusable.

But fortunately I found a solution in this post:

https://unix.stackexchange.com/questions/192493/how-to-use-xfig-on-high-dpi-screen/202277

These instructions are for xfig, but they work for other applications that have the same problem. These are the steps I followed to get this problem solved. First I installed the latest release of "Vncdesk" from the release page in Github:

https://github.com/feklee/vncdesk/releases

To install it I just decompressed the tarball and in the root directory created I ran:

pip3 install .

Make sure you have pip3 installed (sudo apt install python3-pip). In Vncdesk readme it says it can work with TigerVNC 1.4, TightVNC 1.3, or RealVNC 4.1. I instaled TigerVNC:

sudo apt install tigervnc-standalone-server tigervnc-viewer

I had to install also gtk-vnc:

sudo apt install gvncviewer

This will pull it through the dependencies. To run xfig in the vnc viewer, you have to create first a hidden folder called ".vncdesk" and there create another one called "1" (for each application you have to create one of these subfolders, for instance "2", "3" and so on). In the "1" subfolder you have to create a file called "settings.ini" where you define some parameters for your application. These are the parameters that work for me for xfig:

[desktop]
width = 1400
height =770
depth = 24

[window]
title = Xfig
name = Xfig in vncdesk
class = XfiginVncdesk
scale_factor = 1.3
smoothing = false

Play with the "width", "height" and "scale_factor" to adjust it for your application. To actually start xfig, another file has to be created in "1" named "startup" and with the following content:

#!/bin/sh
xrdb -merge ~/.Xresources
cd "$INVOCATION_DIR"
exec xfig -geometry ${WIDTH}x$HEIGHT+0+0 "$@"

In the ".Xresources" file you can put your X11 parameters for xfig. It is optional, and not needed for other applications that do not use X11 resources.

To actually run xifg, you just enter the following at the command line (change "1" by any other number if you have other applications in "2", "3" or other subfolders):

vncdesk 1

You can also provide arguments to your application by writing them at the end of this command. With this, xfig menus and icons will look right: