Fix incorrect color format in x11 cursor (bgr instead of rgb)

This commit is contained in:
dec05eba
2024-11-09 02:45:16 +01:00
parent e647d0c4bc
commit f1b4979365
11 changed files with 27 additions and 55 deletions

View File

@@ -43,10 +43,12 @@ static bool gsr_cursor_set_from_x11_cursor_image(gsr_cursor *self, XFixesCursorI
*visible = true;
}
*out++ = (unsigned)*in++ * 255/alpha;
*out++ = (unsigned)*in++ * 255/alpha;
*out++ = (unsigned)*in++ * 255/alpha;
*out++ = *in++;
out[0] = (float)in[2] * 255.0/(float)alpha;
out[1] = (float)in[1] * 255.0/(float)alpha;
out[2] = (float)in[0] * 255.0/(float)alpha;
out[3] = in[3];
out += 4;
in += 4;
}
}