[prev in list] [next in list] [prev in thread] [next in thread]
List: wine-patches
Subject: winex11.drv: Calculate the cursor bitmap offsets in a way consistent
From: "Andrew Riedi" <andrewriedi () gmail ! com>
Date: 2008-12-31 0:45:16
Message-ID: 689de9370812301645l2cc25957g45983eeb619431c0 () mail ! gmail ! com
[Download RAW message or body]
This partially fixes bug #9952. ( http://bugs.winehq.org/show_bug.cgi?id=9952 )
May also impact bug #16558. ( http://bugs.winehq.org/show_bug.cgi?id=16558 )
The current code assumes that cursors are factors of 8 in size and
thus incorrectly calculates the XOR offset. This patch fixes the
offset for the XOR bitmap. Making the AND bitmap render correctly is
a more complicated matter, and is really a separate issue, so it will
have to be fixed in a separate patch.
Changelog:
winex11.drv: Calculate the cursor bitmap offsets in a way consistent
with user32.
--
Andrew Riedi
["0003-winex11.drv-Calculate-the-cursor-bitmap-offsets-in-a.txt" (text/plain)]
From 21c50501b0def1bbbddfe940934b2ddfb917d60c Mon Sep 17 00:00:00 2001
From: Andrew Riedi <andrewriedi@gmail.com>
Date: Wed, 24 Dec 2008 14:35:39 -0800
Subject: [PATCH] winex11.drv: Calculate the cursor bitmap offsets in a way consistent with user32.
---
dlls/winex11.drv/mouse.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c
index b79f149..728a8cd 100644
--- a/dlls/winex11.drv/mouse.c
+++ b/dlls/winex11.drv/mouse.c
@@ -436,10 +436,10 @@ static XcursorImage *create_cursor_image( CURSORICONINFO *ptr )
unsigned char tmp;
BOOL alpha_zero = TRUE;
- and_width_bytes = ptr->nWidth / 8;
- xor_width_bytes = and_width_bytes * ptr->bBitsPerPixel;
+ and_width_bytes = 2 * ((ptr->nWidth+15) / 16);
+ xor_width_bytes = ptr->nWidthBytes;
- and_size = ptr->nWidth * ptr->nHeight / 8;
+ and_size = ptr->nHeight * and_width_bytes;
and_ptr = and_bits = (unsigned char *)(ptr + 1);
xor_ptr = xor_bits = and_ptr + and_size;
--
1.5.6.3
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic