From fbf5905ccbc5e95bf22357f39f139216db65676d Mon Sep 17 00:00:00 2001 From: Aaron Klotz Date: Tue, 14 Oct 2025 13:14:55 -0600 Subject: [PATCH] menu.go: ensure that owner-draw/bitmap separators are flagged as such The code that flags separators was being treated as mutually-exculsive to owner-draw/bitmap items. We move the separator stuff out of the switch block into its own if statement to ensure that it is always run regardless of an item's owner-draw/bitmap setting. Updates https://github.com/tailscale/tailscale/issues/17535 Signed-off-by: Aaron Klotz --- menu.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/menu.go b/menu.go index dba6c9ac..e905f950 100644 --- a/menu.go +++ b/menu.go @@ -239,10 +239,15 @@ func (m *Menu) initMenuItemInfoFromAction(mii *win.MENUITEMINFO, action *Action) if bmp, err := iconCache.Bitmap(action.image, dpi); err == nil { mii.HbmpItem = bmp.hBmp } - case action.IsSeparator(): + default: + } + + // Being a separator is not mutually-exclusive to being an image or + // owner-draw item, so we must perform this check separately from the + // switch above. + if action.IsSeparator() { mii.FType |= win.MFT_SEPARATOR setString = false - default: } if setString {