aboutsummaryrefslogtreecommitdiff
path: root/src/cursor.c
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-11-09 02:45:16 +0100
committerdec05eba <dec05eba@protonmail.com>2024-11-09 02:45:20 +0100
commitf1b49793658d42cc7dd53be757f34ec6437d0517 (patch)
tree3f56bed82946d54a61a371b42264f29546f9485a /src/cursor.c
parente647d0c4bcbd7001b81a7a3618987e220615f2d6 (diff)
Fix incorrect color format in x11 cursor (bgr instead of rgb)
Diffstat (limited to 'src/cursor.c')
-rw-r--r--src/cursor.c10
1 files changed, 6 insertions, 4 deletions
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;
}
}