https://bugs.winehq.org/show_bug.cgi?id=54906
Bug ID: 54906 Summary: Menu items with icons are drawn with black squares if Wine is running in Vista+ mode Product: Wine Version: 8.7 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: user32 Assignee: wine-bugs@winehq.org Reporter: george.hazan@gmail.com Distribution: ---
The following construction fails in the all 8.x versions of Wine (currently I upgraded to version 8.7 devel) and works Ok in Wine 7.1:
MENUITEMINFO mii = {}; mii.cbSize = sizeof(mii); mii.fMask = MIIM_STRING | MIIM_STATE; if (pimi->iconId != -1) { mii.fMask |= MIIM_BITMAP; if (IsWinVerVistaPlus() && IsThemeActive()) { if (pimi->hBmp == nullptr) pimi->hBmp = ConvertIconToBitmap(pimi->parent->m_hMenuIcons, pimi->iconId); mii.hbmpItem = pimi->hBmp; } else mii.hbmpItem = HBMMENU_CALLBACK; } InsertMenuItemW(hMenu, uItem, TRUE, &mii);
I.e. if I run command 'winecfg -v win2003', then everything is Ok with icons, otherwise I see black squares instead of icons. This code works Ok under all versions of Windows, from XP to Windows 11, the problem is specific to Wine 8.x under Linux (I use Kubuntu 23.04).
To see the problem you can download my open source messenger Miranda NG from https://miranda-ng.org/downloads, just download a ZIP, run it and open main or tray icon menu. The full source code is avalable here: https://github.com/miranda-ng/miranda-ng, you need module menu_utils.cpp inside mir_app, InsertMenuItemWithSeparators or BuildRecursiveMenu functions.
WMBR, George Hazan.