From f1b49793658d42cc7dd53be757f34ec6437d0517 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 9 Nov 2024 02:45:16 +0100 Subject: Fix incorrect color format in x11 cursor (bgr instead of rgb) --- src/cursor.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/cursor.c') diff --git a/src/cursor.c b/src/cursor.c index 3dca0c6..56b9694 100644 --- a/src/cursor.c +++ b/src/cursor.c @@ -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; } } -- cgit v1.2.3