X11 Multiple Monitor DPI trick

One issue with x11 is that there is no per monitor dpi property, there is only a global dpi property. Hidpi content doesn’t work properly on windows either as windows will simply upscale windows when using different dpi per monitor, making the window content blurry, unless the application supports different dpi per monitor. This is also an issue under wayland as currently compositors simply upscale xwayland applications, making them blurry. A solution for this with x11 is to set the monitor scale with xrandr to make a monitor behave as if it’s using a large resolution than it actually is and then setting programs dpi scaling with Xft.

X11 myth: X11 doesn’t support HDR

People often claim that x11 doesn’t support HDR but that is not true. HDR can be enabled by setting x11 color depth to 30 (10-bits per color component) and software running under x11 can detect 10-bit mode and display HDR content. You can set color depth to 30 in x11 by creating /etc/X11/xorg.conf.d/30-hdr.conf (location may differ on your distro) with the content: Section "Screen" Identifier "Default Screen" Monitor "Configured Monitor" Device "Configured Video Device" # 24 for 8-bit or 30 for 10-bit DefaultDepth 30 EndSection The DefaultDepth 30 part enables HDR support.

X11 myth: X11 is not secure

Wayland advocates often complain about “security” in x11. One of the complaints is how you can have a keylogger without sudo privileges (for example xinput can do this). This video shows xkbcat, a keylogger for x11 being restricted to windows it owns only, preventing keylogging. Bottom right is xkbcat running in a terminal and top right is a window it owns. As you can see, it can only see keys that were input to a window it owns.

Accessing X11 window texture without copying

X11 has an extension called XComposite, which are often used by compositors, but these features can also be used in regular programs for getting direct access to the opengl texture associated with an X11 window. This is done using the XCompositeRedirectWindow, XCompositeNameWindowPixmap, glXCreatePixmap and glXBindTexImageEXT functions. See window-texture for a code example or for simple functions to use in your program. I’ve used this feature to make the fastest fully GPU accelerated screen (window) recorder on linux.