From 3763f508e8b6737b04a07f3200fb5b3be04ddd86 Mon Sep 17 00:00:00 2001 From: Anton Bolshakov Date: Tue, 21 Jul 2026 22:07:20 +0800 Subject: [PATCH] x11_create_gc: set alpha byte on gc_bg_id fg pixel in ARGB mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- glass.asm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/glass.asm b/glass.asm index f94e546..0c41be4 100644 --- a/glass.asm +++ b/glass.asm @@ -3430,6 +3430,13 @@ x11_create_gc: .xgcbg_def: mov eax, [x11_black_pixel] .xgcbg_set: + cmp dword [x11_argb_colormap], 0 + je .xgcbg_no_alpha + and eax, 0x00FFFFFF + movzx ecx, byte [cfg_opacity] + shl ecx, 24 + or eax, ecx +.xgcbg_no_alpha: mov [rdi+16], eax lea rsi, [tmp_buf]