Skip to content

x11_create_gc: apply opacity alpha to gc_bg_id fg pixel in ARGB mode#5

Open
blshkv wants to merge 1 commit into
isene:masterfrom
blshkv:fix/gc-bg-alpha-argb-transparency
Open

x11_create_gc: apply opacity alpha to gc_bg_id fg pixel in ARGB mode#5
blshkv wants to merge 1 commit into
isene:masterfrom
blshkv:fix/gc-bg-alpha-argb-transparency

Conversation

@blshkv

@blshkv blshkv commented Jul 21, 2026

Copy link
Copy Markdown

Closes #4

cfg_bg_pixel stores only a 24-bit RGB value (high byte = 0x00). When the compositor is active the window uses an ARGB visual, and XFillRectangle with a GC whose fg pixel has alpha=0x00 produces a fully-transparent fill.

ensure_back_buffer recreates the back-pixmap on every resize and immediately fills it with gc_bg_id to clear the undefined initial contents. Because gc_bg_id.fg_pixel carried alpha=0, the entire background became invisible after any resize.

Fix: apply the same cfg_opacity → alpha fixup already used in x11_create_window (CW_BACK_PIXEL path) when building the gc_bg_id foreground pixel.

🤖 Generated with Claude Code

cfg_bg_pixel stores only a 24-bit RGB value (high byte = 0x00).  When the
compositor is active the window uses an ARGB visual, and XFillRectangle with
a GC whose fg pixel has alpha=0 produces a fully-transparent fill.

ensure_back_buffer re-creates the back-pixmap on resize and immediately
fills it with gc_bg_id to clear the undefined initial contents.  Because
gc_bg_id carried alpha=0 the entire background became invisible after any
resize, revealing the window beneath the terminal.

Fix: apply the same cfg_opacity→alpha fixup already used by
x11_create_window (CW_BACK_PIXEL path) when building the gc_bg_id
foreground pixel.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@blshkv
blshkv force-pushed the fix/gc-bg-alpha-argb-transparency branch from 3560bdb to 3763f50 Compare July 21, 2026 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Background becomes fully transparent after resizing from large to small window

1 participant