Solved 2026-10-13. Compiz 0.9.14.2 (ini backend), XFCE / LightDM,
GeForce GTX 760 on the legacy NVIDIA 470 driver, X11,
focus-follows-mouse, no autoraise, no click-to-focus.
SYMPTOMS - one cause, two faces
Both only with GTK4 apps, and both disappear with the cairo renderer.
a) STALE FIRST FRAME, looks like a transparent window.
The window shows whatever is behind it - wallpaper, other windows -
sharply, not blended. Only widgets that redraw themselves (buttons,
column headers) and the WM title bar look right.
It strikes ONCE per application start, on the first focus transition
into the window. Moving the pointer across the window heals it for
the rest of that window’s life.
It needs a window with a large area whose content never changes.
A list with rows never shows it: hovering rows keeps invalidating
them, so a fresh frame always replaces the bad one. An empty or
one-row list invalidates never, so the bad frame is never replaced.
b) MISSING SCROLLBAR THUMBS.
In a scrollable list the thumb is simply not drawn. Needs enough
content to scroll, so it shows in exactly the cases (a) does not.
CAUSE
GTK4’s default GL renderer on this driver. Its frames are not composited
correctly, and a window that never invalidates again never submits a
replacement frame. Nothing to do with any compiz setting.
FIX
GSK_RENDERER=cairo in /etc/environment
Syntax there is plain KEY=VAL - no export, no variable expansion.
It is applied by pam_env, pulled in via /etc/pam.d/system-login, which
the display manager’s PAM stack includes. That is the one place that
reaches the whole session INCLUDING the systemd user manager.
Effective at the next login; no reboot required.
Cairo is a software renderer. Irrelevant for dialogs, lists and forms.
This is a local driver/compositor quirk, NOT an application bug.
Do not hardcode GSK_RENDERER into application source: it would force a
software renderer on every user of that program, on every machine.
To apply it to a running session without logging out:systemctl --user set-environment GSK_RENDERER=cairo
then restart the affected application. Only NEW units inherit it;
already-running processes keep the environment they started with.
WHY THIS IS SO CONFUSING: WHICH LAUNCH PATH READS WHAT
interactive terminal /.bashrc
login shell, tty, ssh /.bash_profile
X session children /.profile and /.xprofile
(file manager, panel, (sourced by the display manager’s
dock, desktop files) Xsession script)
systemd user scope NOTHING - no shell is involved at all
Docks and desktop environments increasingly start applications as
systemd user scopes rather than forking them. Such a process shows
MANAGERPID and SYSTEMD_EXEC_PID in its environment - a reliable tell.
It inherits the systemd user manager’s environment, which no shell
startup file ever touches.
Consequence here: an IDE started from the dock had no GSK_RENDERER, so
everything launched FROM that IDE inherited the GL renderer and broke,
while the same program started from a terminal or a file manager was
always fine. Setting the variable in ~/.xprofile fixed only the third
row of the table and left the IDE broken - which looks exactly like an
intermittent bug. /etc/environment covers all four rows.
Trap while debugging this: /proc/PID/environ shows the environment as it
was at EXEC time. A program that calls setenv() at runtime (Eclipse’s
SWT does, e.g. GDK_CORE_DEVICE_EVENTS=1, LIBOVERLAY_SCROLLBAR=0,
SWT_GTK4=0) passes those to its children while its own environ shows
none of them. Read the CHILD’s environ, not the parent’s.
HOW TO TEST IT CORRECTLY
Symptom (a) is a ONE-SHOT per application start. Do NOT move, resize or
raise the window before looking at it: each of those generates damage,
forces the repaint and consumes the symptom. Tests that reposition the
window before measuring will show a clean window and prove nothing -
this mistake cost a full day and produced several confident, wrong
conclusions.
Valid comparison: launch the same app twice from the same shell with the
same file, leave both windows untouched after they map, vary only the
renderer. Give the two instances different window titles (e.g. symlink
the same file into two differently named directories) so they can be
told apart:
env -u GSK_RENDERER <gtk4-app> <file> -> broken env GSK_RENDERER=cairo <gtk4-app> <file> -> correct
Useful objective check instead of eyeballing: screenshot the window’s
flat content area and compute its standard deviation. A correctly
painted flat area gives 0; a stale one shows the content behind it and
gives a clearly non-zero value. Discard any sample where another window
overlaps the measured rectangle, or occlusion will read as a false
positive.
RULED OUT, WITH EVIDENCE - do not retest these
- decor shadow geometry (active vs inactive radius/offset). An earlier
version of this note claimed that making them identical was the cure.
IT IS NOT - the bug occurs with perfectly symmetric shadows. That
conclusion came from a flaky reproducer and is superseded. - workarounds/force_swap_buffers - no effect in either direction;
stale frames continued unchanged with it on and off, sampled every
5 s for about 45 minutes. - workarounds/force_glx_sync - no effect, despite its tooltip
mentioning Nvidia redraw problems. - opengl/texture_compression, decor/mipmap, fade/dim_unresponsive.
- animation focus effects (already ‘None’).
- the GTK theme: a heavily customised theme and stock Adwaita behave
identically. - which monitor the window is on, in a dual-head setup.
- the list widget: minimal GTK4 apps using the deprecated Gtk.TreeView
and using Gtk.ListBox behave identically, so it is not a legacy-widget
problem. - GDK_CORE_DEVICE_EVENTS=1, LIBOVERLAY_SCROLLBAR=0, SWT_GTK4=0 - the
variables an Eclipse/SWT parent injects into its children. - how the IDE itself is started: its launcher is a plain ELF binary and
its .ini sets no environment at all.
COMPIZ CONFIG HANDLING (unrelated to the fix, but easy to get wrong)
Config lives in ~/.config/compiz-1/compizconfig/Default.ini, with a
‘config’ file next to it selecting the ini backend. Compiz OWNS that
file and rewrites it.
- Options can be set live over D-Bus, and compiz persists them itself:
dbus-send --type=method_call --dest=org.freedesktop.compiz /org/freedesktop/compiz/<plugin>/screen0/<option> org.freedesktop.compiz.set boolean:true
Use double: for floats, int32: for integers; .get reads a value back.
- CCSM shows LABELS, not key names. force_swap_buffers appears as
‘Force full screen redraws (buffer swap) on repaint’ under
Utility / Workarounds. - If CCSM was already open when you changed something over D-Bus, it
holds a stale copy and saving from it overwrites the newer values.
Close and reopen it first. - Restore a backed-up Default.ini only while compiz is NOT running: it
keeps the whole configuration in memory and rewrites the file on exit. - The file is machine-specific: the outputs option holds the monitor
layout, and image options hold absolute paths. - Decimal separators follow the locale compiz had when it wrote the file
(‘13.000000’ vs ‘13,000000’). Re-check values after restoring such a
file under a different LC_NUMERIC. - decor caps inactive_shadow_radius at 13.0 while active_shadow_radius
allows up to 18.0 - asking for 15 on both sides silently leaves the
inactive one at 13.