Fix the collapsed cat window on Linux, warn about the compositor

The CatDefs singleton did not resolve on the reporter's Linux build, which
showed up as "property mood of object CatDefs is not a function". The same
lookup failure made CatDefs.aspect undefined, so the cat window's height became
NaN and the cat rendered as a moving line. The mug survived because its height
used a literal ratio.

The singleton is gone rather than repaired, since nothing in it had to be
shared. The mood name now comes from C++, derived from the enum key, so there
is one source of truth instead of a list in QML that had to match. Window sizes
now follow the implicit size of the drawing they contain, so the proportions
live in the one file that defines them.

Also for X11: TNCat now warns, naming Xfce's compositor setting, when its
window comes up without an alpha channel, which is what a missing compositor
looks like and why the mug had a black background. Opaque mode no longer hides
the chip and the mug. TNCAT_DEBUG=1 logs window geometry.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
JulianandClaude Opus 5 committed 2026-09-11 09:33:44 +02:00
1 parent 9106ce47f4
commit 0aceb3665d
12 files changed
+94 -36

No files matched your search

+17
View File
@@ -75,6 +75,7 @@ otool -L build/tncat.app/Contents/MacOS/tncat | grep -o 'Qt[A-Za-z]*\.framework'
| `TNCAT_OVERLAY=1` | Forces the screen-filling overlay layout that Wayland needs, for testing it on X11. |
| `TNCAT_OPAQUE=1` | Paints a solid background instead of relying on transparency. Use when no compositor runs and the cat sits in a black box. |
| `TNCAT_POSE=Sitting` | Freezes the cat in one mood. Handy for screenshots. Accepts any `CatController::Mood` name. |
| `TNCAT_DEBUG=1` | Logs the cat window's geometry and the screen it sits on, every time either changes. First thing to try when a window comes up the wrong size. |
| `QT_QUICK_BACKEND=software` | Qt Quick's software rasteriser, for machines without a usable OpenGL driver. `Shape` falls back to its geometry renderer on its own. |
## Two window layouts
@@ -94,6 +95,22 @@ Overlay mode switches on automatically on Wayland. `TNCAT_OVERLAY=1` turns it on
anywhere for testing. It is not the default elsewhere because macOS ignores the
input mask, which would make the overlay swallow every click on the desktop.
## Xfce and X11
This is the main target. Two things to know.
**Transparency needs a compositor.** Without one, X11 has no alpha channel to
composite against and the transparent window background renders as a black box
around the cat. In Xfce it is one checkbox: Settings, Window Manager Tweaks,
Compositor, Enable display compositing. TNCat prints a warning naming that
setting when its window comes up without an alpha channel. `TNCAT_OPAQUE=1`
paints a solid background instead, which is usable but not pretty.
**Keeping the cat on top.** The default is a frameless `Qt::Tool` window that
stays on top. If the window manager puts it behind other windows or shows it in
the taskbar, `TNCAT_X11_BYPASS=1` makes it an override-redirect window that the
window manager does not manage at all.
## Running on a HEIDENHAIN control
Untested on real hardware so far. What the code already does for that target: