Alex Henrie (@alexhenrie) commented about dlls/winex11.drv/bitblt.c:
if (src != dst) { - int map[256], *mapping = get_window_surface_mapping( ximage->bits_per_pixel, map ); + int *mapping = NULL; int width_bytes = ximage->bytes_per_line;
+ if (ximage->bits_per_pixel == 4 || ximage->bits_per_pixel == 8) + mapping = X11DRV_PALETTE_PaletteToXPixel;
Although this change helps with the default case where the application does not change the palette, I still don't think it's exactly right. We should be mapping from the window's selected palette to whatever the X server palette is. (To simplify things, I suggest that we try to get it working with a static, unchangeable X server palette first. Passing `-cc 2` to Xephyr makes it use a StaticColor palette.) Unfortunately, I don't know how to get the window's selected palette from x11drv_surface_flush. Any idea how to get that information? -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9619#note_124245