winex11: Invert the icon mask only after the conversion to ARGB.
This commit is contained in:
parent
0b9b96a81b
commit
9ff982f2a8
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue