On Tue Feb 4 16:54:48 2025 +0000, Paul Gofman wrote:
Well, the difference is that escape.use_alpha is set in the place where such things are managed, while xrender doesn't need to have logic tangled with the entirety of winex11.drv. data->use_alpha is set whenever we consider alpha-enabled visual, for ULW windows and conditionally for systray. If we set use_alpha because we wanted alpha but our visual doesn't have it then the proper xrender format will be selected based on visual depth check? In your variant what is going to make sure if we are going to actually select argb visual when we want it? depth can be 32 both for, e. g., WXR_FORMAT_A8R8G8B8 / WXR_FORMAT_X8R8G8B8. Any will be compatible as in avoiding X error probably, but we do want one or another depending on whether we do use alpha or not (and that is given by data->use_alpha)?
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. */