Graphical Glitches in GTK4 apps

If you are using Ubuntu 24.04 or 24.10, you may have noticed that GTK4 applications can sometimes display glitchy graphics. Icons and images in the window may flicker or appear distorted.

Distorted icons in Appy

The Problem

Gtk v4.14 switched to a new default renderer called ngl. The new renderer is supposed to be an improvement over the older gl renderer. The code is simpler and easier to maintain for the developers, and should perform better when it is further optimized in the future.

On the downside, the code is still very new and has bugs when interacting with certain graphics drivers. This leads to the visual glitches that you see in Gtk4 applications.

The old GL renderer is currently faster and is more well-tested since it has been around for a longer time.

The Solution

Switch back to the old (and well-tested) GL renderer.

Run the following command in a terminal and reboot.

echo "GSK_RENDERER=gl" | sudo tee -a /etc/environment

Here are the other renderers that you can use:

* broadway - Use the Broadway specific renderer
* cairo    - Use the Cairo fallback renderer
* opengl   - Use the OpenGL renderer
* gl       - Use the OpenGL renderer
* ngl      - Use the new OpenGL renderer
* vulkan   - Use the Vulkan renderer

It is recommended to stick with the gl renderer (unless you know what you are doing).


See also