Commit Graph
4 Commits
Author SHA1 Message Date
JulianandClaude Opus 5 d685bf492a Shape the window when there is no compositor
On Xfce with compositing off, X11 has no alpha to blend against, so the
transparent background came out as a black box around the cat.

When a window comes up without an alpha channel, TNCat now cuts the window down
to the pixels the drawing covers, using the X11 shape extension, and refreshes
that 15 times a second so it follows the animation. A sitting cat in a 120 x 106
window comes out as 96 rectangles over 29 percent of the window, so most of the
box is gone. Edges are harder than with a compositor, one bit per pixel, and the
log says so and names the Xfce setting that gives smooth ones instead.

The image-to-rectangles step is platform independent and folds every device row
into its window row, which both halves the rectangle count on a scaled display
and keeps a pixel that is opaque in only one of them.

xcb and xcb-shape are picked up through pkg-config on Unix and the build still
works without them. Opaque mode now paints a neutral card rather than the coat
colour.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-11 09:49:51 +02:00
JulianandClaude Opus 5 0aceb3665d 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>
2026-09-11 09:33:44 +02:00
JulianandClaude Opus 5 f6ecf0ddbf Give the chip a box it fits in, and a spin that settles
The chip window was 60 x 44 with the curl tumbling about its centre. The curl
reaches 24.2 units from that pivot once the stroke is counted, so a half height
of 22 clipped the top and bottom off it on every turn.

The box is now 52 x 58 with the pivot at (26, 33), measured off the actual
Bezier curve rather than its control points. The shadow sits at 15.1 below the
pivot, which is where the curl comes to rest, so the chip lands on its own
shadow instead of floating above it.

The endless rotation is gone. Each bat now adds one or two whole turns in the
direction it was hit and coasts to a stop, so the resting silhouette is always
the same one, the one the shadow was placed under.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-11 07:12:11 +02:00
JulianandClaude Opus 5 0f1df75a1d Rename to TNCat, add chip chase, G-codes and a Wayland layout
The project is now TNCat, after HEIDENHAIN's TNC controls. Binary, QML module
URI, settings path, bundle id and .desktop entry follow; the environment
switches are TNCAT_*.

Entertainment: a curled steel chip skitters in every minute or two, the cat
runs it down and bats it away a few times before sitting back looking pleased.
Mood changes flash the matching machine code above its head, G00 for a sprint,
G01 for a stroll, M08 while it washes, G28 for a stretch, M30 for a nap.

Window handling was split into two layouts. X11 and macOS keep one small window
per object, positioned by the app. Wayland gets a screen-filling overlay whose
input region is masked down to the cat, since a Wayland client cannot place its
own window. Overlay mode is automatic there and available elsewhere via
TNCAT_OVERLAY=1.

Also adds a ground-line setting so the cat can walk above a softkey row.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-10 22:53:40 +02:00