On Tue Feb 4 17:26:03 2025 +0000, Paul Gofman wrote:
I checked with my trigger case with Crysis 3 and the alternative variant also avoids the problem. It probably correctly selects alpha enabled formats because those formats are listed above matching non-alpha enabled ones. If you think that it is all clearer across the board maybe worth adding the comment in the alternative variant near that visual check? Like: /* Non-default visual is only used when alpha is required. */
I was progressing toward getting rid of that `use_alpha` flag and I think it could even be dropped already, it's not very useful anymore as most of the related logic has been moved to win32u.
Every layered window (and that includes systray windows) has an alpha channel in the window surface. What may be different then is how this alpha channel is being used when the pixels are sent to X(Render), they may or may not be used depending on the available visuals, and we should prefer using alpha when possible, but otherwise it's just getting ignored.
I've made a small tweak to the logic, to hopefully make it less misleading, checking `if (fmt->alphaMask && visual->class != TrueColor) return FALSE;` instead.