wxOSX: menu item bitmaps are hidden on macOS 27 because NSMenuItem.preferredImageVisibility is never set (Issue #27019)

34 views
Skip to first unread message

Tommy Krul

unread,
Sep 17, 2026, 9:48:53 PM (6 days ago) Sep 17
to wx-...@googlegroups.com, Subscribed
Tommykrul created an issue (wxWidgets/wxWidgets#27019)

Description

Bug description

On macOS 27, bitmaps set on a wxMenuItem are no longer displayed. We observed this in a popup (context) menu. As shown below, menu bar items are left in the same state, and it makes no difference whether SetBitmap() is called before or after the item is appended.

macOS 27 added a new property, NSMenuItem.preferredImageVisibility (type NSMenuItemImageVisibility, API_AVAILABLE(macos(27.0))). Its default for every item is NSMenuItemImageVisibilityAutomatic, and under that default the SDK documentation says AppKit "will typically hide images". An item has to opt in with NSMenuItemImageVisibilityVisible to keep showing its image.

wxOSX never sets this property, so every menu item bitmap stays at the hiding default.

Expected vs observed behaviour

  • Expected: the bitmap is shown next to the menu item, as on macOS 26 and earlier.
  • Observed: the icon is entirely absent (not greyed or tinted). The image is attached to the native item -- NSMenuItem.image is non-nil at the correct size -- but AppKit does not draw it.

Root cause

wxMenuItemCocoaImpl::SetBitmap() in src/osx/cocoa/menuitem.mm (line 254 on current master) only calls setImage::

void SetBitmap( const wxBitmapBundle& bitmap ) override
{
    [m_osxMenuItem setImage:wxOSXGetImageFromBundle(bitmap)];
}

The relevant declarations are in AppKit.framework/Headers/NSMenuItem.h of the macOS 27 SDK: the NSMenuItemImageVisibility enum and the preferredImageVisibility property, both marked API_AVAILABLE(macos(27.0)). The documentation comment on NSMenuItem.image also refers to the new property.

To Repr


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/27019@github.com>

Stefan Csomor

unread,
Sep 18, 2026, 9:11:16 AM (5 days ago) Sep 18
to wx-...@googlegroups.com, Subscribed
csomor left a comment (wxWidgets/wxWidgets#27019)

@Tommykrul, thanks for isolating this problem. One additional question: when building under macOS 26 / against 26 SDK, and running under 27, are the bitmaps visible as before?
That OS change seems like a funny way to get rid of the Tahoe UI Disaster ...


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/27019/5730469771@github.com>

VZ

unread,
Sep 20, 2026, 12:57:43 PM (3 days ago) Sep 20
to wx-...@googlegroups.com, Subscribed

Closed #27019 as completed via 250f597.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issue/27019/issue_event/31486889195@github.com>

Tommy Krul

unread,
Sep 21, 2026, 1:16:00 PM (2 days ago) Sep 21
to wx-...@googlegroups.com, Subscribed
Tommykrul left a comment (wxWidgets/wxWidgets#27019)

@csomor Thanks for the quick follow up. I didn't try building wxWidgets against the macOS 26 SDK. I think the last time I build my wx libs was against Tahoe


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/27019/5764540631@github.com>

Reply all
Reply to author
Forward
0 new messages