Commit 6ad6517a authored by Olivier Fourdan's avatar Olivier Fourdan 🛠
Browse files

xwayland: Fix cursor color

When using colored X11 cursors, the colors would appear wrong, yellow
would show white, green would show as cyan, and blue would show black
whereas red would show fine.

This is because the code expanding the cursor data accounts for green
for both green and blue channels. Funnily this bug has been there from
the beginning.

Fix the issue by correctly account for the color channels.

Closes: #1303

Signed-off-by: Olivier Fourdan's avatarOlivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Simon Ser's avatarSimon Ser <contact@emersion.fr>
Reviewed-by: Michel Dänzer's avatarMichel Dänzer <mdaenzer@redhat.com>
parent 1801fe0a
Pipeline #506736 passed with stages
in 5 minutes and 6 seconds
......@@ -54,9 +54,11 @@ expand_source_and_mask(CursorPtr cursor, CARD32 *data)
p = data;
fg = ((cursor->foreRed & 0xff00) << 8) |
(cursor->foreGreen & 0xff00) | (cursor->foreGreen >> 8);
(cursor->foreGreen & 0xff00) |
(cursor->foreBlue >> 8);
bg = ((cursor->backRed & 0xff00) << 8) |
(cursor->backGreen & 0xff00) | (cursor->backGreen >> 8);
(cursor->backGreen & 0xff00) |
(cursor->backBlue >> 8);
stride = BitmapBytePad(bits->width);
for (y = 0; y < bits->height; y++)
for (x = 0; x < bits->width; x++) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment