diff options
Diffstat (limited to 'xorg-server/hw/xwin/winmultiwindowicons.c')
-rw-r--r-- | xorg-server/hw/xwin/winmultiwindowicons.c | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/xorg-server/hw/xwin/winmultiwindowicons.c b/xorg-server/hw/xwin/winmultiwindowicons.c index df59f6066..42bdb5f9c 100644 --- a/xorg-server/hw/xwin/winmultiwindowicons.c +++ b/xorg-server/hw/xwin/winmultiwindowicons.c @@ -250,19 +250,21 @@ NetWMToWinIconAlpha(uint32_t * icon) HICON result; HDC hdc = GetDC(NULL); uint32_t *DIB_pixels; - ICONINFO ii = { TRUE }; - BITMAPV4HEADER bmh = { sizeof(bmh) }; + ICONINFO ii; + BITMAPV5HEADER bmh; /* Define an ARGB pixel format used for Color+Alpha icons */ - bmh.bV4Width = width; - bmh.bV4Height = -height; /* Invert the image */ - bmh.bV4Planes = 1; - bmh.bV4BitCount = 32; - bmh.bV4V4Compression = BI_BITFIELDS; - bmh.bV4AlphaMask = 0xFF000000; - bmh.bV4RedMask = 0x00FF0000; - bmh.bV4GreenMask = 0x0000FF00; - bmh.bV4BlueMask = 0x000000FF; + ZeroMemory(&bmh,sizeof(bmh)); + bmh.bV5Size = sizeof(bmh); + bmh.bV5Width = width; + bmh.bV5Height = -height; /* Invert the image */ + bmh.bV5Planes = 1; + bmh.bV5BitCount = 32; + bmh.bV5Compression = BI_BITFIELDS; + bmh.bV5AlphaMask = 0xFF000000; + bmh.bV5RedMask = 0x00FF0000; + bmh.bV5GreenMask = 0x0000FF00; + bmh.bV5BlueMask = 0x000000FF; ii.hbmColor = CreateDIBSection(hdc, (BITMAPINFO *) & bmh, DIB_RGB_COLORS, (void **) &DIB_pixels, NULL, @@ -274,6 +276,9 @@ NetWMToWinIconAlpha(uint32_t * icon) /* CreateIconIndirect() traditionally required DDBitmaps */ /* Systems from WinXP accept 32-bit ARGB DIBitmaps with full 8-bit alpha support */ /* The icon is created with a DIB + empty DDB mask (an MS example does the same) */ + ii.fIcon = TRUE; + ii.xHotspot = 0; + ii.yHotspot = 0; result = CreateIconIndirect(&ii); DeleteObject(ii.hbmColor); @@ -291,7 +296,7 @@ NetWMToWinIconThreshold(uint32_t * icon) uint32_t *pixels = &icon[2]; int row, col; HICON result; - ICONINFO ii = { TRUE }; + ICONINFO ii; HDC hdc = GetDC(NULL); HDC xorDC = CreateCompatibleDC(hdc); @@ -321,6 +326,9 @@ NetWMToWinIconThreshold(uint32_t * icon) DeleteDC(xorDC); DeleteDC(andDC); + ii.fIcon = TRUE; + ii.xHotspot = 0; + ii.yHotspot = 0; result = CreateIconIndirect(&ii); DeleteObject(ii.hbmColor); @@ -355,7 +363,7 @@ NetWMToWinIcon(int bpp, uint32_t * icon) dwlConditionMask); versionChecked = TRUE; - ErrorF("OS has icon alpha channel support: %s\n", + winDebug("OS has icon alpha channel support: %s\n", hasIconAlphaChannel ? "yes" : "no"); } |