Skip to content

Tell the menu's own items apart from the tracked ones by identity - #822

Merged
SimonCropp merged 1 commit into
mainfrom
fix-menu-item-identity
Aug 22, 2026
Merged

Tell the menu's own items apart from the tracked ones by identity#822
SimonCropp merged 1 commit into
mainfrom
fix-menu-item-identity

Conversation

@SimonCropp

@SimonCropp SimonCropp commented Aug 22, 2026

Copy link
Copy Markdown
Member

The items MenuBuilder puts in the menu were told from the ones each open adds by their Text, so a solution named after one of them - Options, Exit, Raise issue - had its group header treated as fixed. The header survived the close that removed everything under it, and the next open added another.

For example, with a pending file from a solution named Options.sln:

open    Exit | Options | Debug view | Open logs | Purge verified files | Raise issue
        ---- | Options | Pending Deletes (1): | file.txt | Discard (1) | Accept all (1)

close   everything from the separator down goes, except the group header, which
        reads as the fixed "Options" entry and stays

open    Exit | Options | Debug view | Open logs | Purge verified files | Raise issue
        Options
        ---- | Options | Pending Deletes (1): | file.txt | Discard (1) | Accept all (1)

and one more inert Options above the separator every time the menu is opened after that. A group header is built with no action, so it cannot be clicked or even selected, and nothing short of restarting the tray clears them.

Matching on text also made the disposal dead. The close removed the tracked items without disposing them, and the next open disposed whatever was still in the collection, which by then was only the fixed six. So every open leaked a menu's worth of controls to the finaliser - which needs no unusual solution name at all.

Both come from holding the fixed items as themselves. Disposal still happens at the next open rather than during the close that removed them.

The items MenuBuilder puts in the menu were told from the ones each open adds by
their Text, so a solution named after one of them - Options, Exit, Raise issue -
had its group header treated as fixed. The header survived the close that removed
everything under it, and the next open added another.

Matching on text also made the disposal dead. The close removed the tracked items
without disposing them, and the next open disposed whatever was still in the
collection, which by then was only the fixed six. So every open leaked a menu's
worth of controls to the finaliser.

Both come from holding the fixed items as themselves. Disposal still happens at the
next open rather than during the close that removed them.
@SimonCropp SimonCropp added this to the 20.0.0 milestone Aug 22, 2026
@SimonCropp
SimonCropp merged commit ec6c40d into main Aug 22, 2026
11 checks passed
@SimonCropp
SimonCropp deleted the fix-menu-item-identity branch August 22, 2026 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant