Module: wine Branch: master Commit: 9ff982f2a8ffaab03382ee6c7407cdc0629ee0aa URL: http://source.winehq.org/git/wine.git/?a=commit;h=9ff982f2a8ffaab03382ee6c74...
Author: Alexandre Julliard julliard@winehq.org Date: Thu Apr 22 14:16:44 2010 +0200
winex11: Invert the icon mask only after the conversion to ARGB.
---
dlls/winex11.drv/window.c | 28 ++++++++++++++-------------- 1 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index bf71cad..a9f274f 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -853,7 +853,7 @@ static unsigned long *get_bitmap_argb( HDC hdc, HBITMAP color, HBITMAP mask, uns ptr = bits + 2; for (i = 0; i < bm.bmHeight; i++) for (j = 0; j < bm.bmWidth; j++, ptr++) - if ((mask_bits[i * width_bytes + j / 8] << (j % 8)) & 0x80) *ptr |= 0xff000000; + if (!((mask_bits[i * width_bytes + j / 8] << (j % 8)) & 0x80)) *ptr |= 0xff000000; HeapFree( GetProcessHeap(), 0, mask_bits ); } HeapFree( GetProcessHeap(), 0, info ); @@ -923,19 +923,6 @@ static void set_icon_hints( Display *display, struct x11drv_win_data *data, rcMask.bottom = bm.bmHeight;
hDC = CreateCompatibleDC(0); - hbmOrig = SelectObject(hDC, ii.hbmMask); - InvertRect(hDC, &rcMask); - SelectObject(hDC, ii.hbmColor); /* force the color bitmap to x11drv mode too */ - SelectObject(hDC, hbmOrig); - - data->hWMIconBitmap = ii.hbmColor; - data->hWMIconMask = ii.hbmMask; - - hints->icon_pixmap = X11DRV_get_pixmap(data->hWMIconBitmap); - hints->icon_mask = X11DRV_get_pixmap(data->hWMIconMask); - destroy_icon_window( display, data ); - hints->flags = (hints->flags & ~IconWindowHint) | IconPixmapHint | IconMaskHint; - bits = get_bitmap_argb( hDC, ii.hbmColor, ii.hbmMask, &size ); if (GetIconInfo( icon_small, &ii )) { @@ -965,6 +952,19 @@ static void set_icon_hints( Display *display, struct x11drv_win_data *data, wine_tsx11_unlock(); HeapFree( GetProcessHeap(), 0, bits );
+ hbmOrig = SelectObject(hDC, ii.hbmMask); + InvertRect(hDC, &rcMask); + SelectObject(hDC, ii.hbmColor); /* force the color bitmap to x11drv mode too */ + SelectObject(hDC, hbmOrig); + + data->hWMIconBitmap = ii.hbmColor; + data->hWMIconMask = ii.hbmMask; + + hints->icon_pixmap = X11DRV_get_pixmap(data->hWMIconBitmap); + hints->icon_mask = X11DRV_get_pixmap(data->hWMIconMask); + destroy_icon_window( display, data ); + hints->flags = (hints->flags & ~IconWindowHint) | IconPixmapHint | IconMaskHint; + DeleteDC(hDC); } }