Skip to content

Commit

Permalink
Fix issue with building "Bookmarks" menu
Browse files Browse the repository at this point in the history
When building the "Bookmarks" menu, the items under the "Bookmarks Menu"
folder are inserted first, followed by the items in the "Other
Bookmarks" folder. A nextMenuId field is used to keep track of the next
available menu item ID.

Previously, that field wasn't being initialized, which meant that if
there were no "Bookmarks Menu" items, the field would never be set. When
inserting the "Other Bookmarks" items, the uninitialized field would be
used. Depending on the exact value of the field, no items might be added
(if the value was above the assigned range), or items might be added,
but not respond correctly when selected.

To fix this, the nextMenuId field is now initialized when building the
menu.
  • Loading branch information
derceg committed Dec 25, 2024
1 parent 44bda34 commit 4bf488b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Documentation/User/History.txt
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ Bug fixes:
appear on the bookmarks toolbar, if the toolbar was initially
empty. The height of the toolbar is now updated when an item is
added, which fixes this issue.
- If the only bookmarks that appeared in the "Bookmarks" menu
were under the "Other Bookmarks" folder, the menu wouldn't be
built correctly.
- Fixed an issue with handling the properties item on the
background context menu.
- Previously, listview groups were always sorted by name. Now,
Expand Down
1 change: 1 addition & 0 deletions Explorer++/Explorer++/Bookmarks/UI/BookmarksMainMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ void BookmarksMainMenu::OnMainMenuPreShow(HMENU mainMenu)
{
std::vector<wil::unique_hbitmap> menuImages;
BookmarkMenuBuilder::MenuInfo menuInfo;
menuInfo.nextMenuId = m_menuIdRange.startId;
auto bookmarksMenu = BuildMainBookmarksMenu(menuImages, menuInfo);

MENUITEMINFO mii;
Expand Down

0 comments on commit 4bf488b

Please sign in to comment.