Etaash Mathamsetty (@etaash.mathamsetty) commented about dlls/winewayland.drv/wayland_surface.c:
+ + copy_rectangle_into_center_of_square(non_square_bits, + bm.bmWidth, bm.bmHeight, + bits); + + free(non_square_bits); + } + else + { + if (!NtGdiGetDIBitsInternal(hdc, color, 0, bm.bmHeight, bits, info, + DIB_RGB_COLORS, 0, 0)) + goto failed; + }
for (i = 0; i < bm.bmWidth * bm.bmHeight; i++) if ((has_alpha = (bits[i] & 0xff000000) != 0)) break; bits would need to be the non-square ones here, and i think in the next for loop as well. I would suggest making a second function for this task or something along those lines. for case 1 where it's rectangular you do the has_alpha check on those non square bits and for case 2 where it's square you do it on just the normal bits.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/9868#note_127958