-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dyn_stack problem with Option<MenuDisplay> #354
Comments
Looks like this part of the code should use an atomicu32 for key function instead of doing s.clone(). The clone is problematic because the separator items will hash the same so as soon as there is more than one the dyn stack will have the count wrong. Unique values are needed |
f for enter misclick 😮💨 I fixed it by changing menu display to enum
separator is is given at
|
Could also make MenuEntry::Separator to have id from static AtomicU64 when its added to Menu but dunno if that's necessary, index from iterator should be unique enough? I can make PR, whatever you think is better? |
The enum looks like a good solution to me. @dzhou121 ? |
Made a pr |
Screenshots that explains the problem: https://imgur.com/a/C1ibQaH
I tracked down the issue to dyn_stack at
src/window_handle.rs
line 1471. dyn_stack takes in proper amount of menu items fromcontext_menu_items
, but iterates less inview_fn
.In
src/views/dyn_stack.rs
when opening the context menuSo collecting to
FxIndexSet
seems to remove (amount of separators - 1) from the end of total menu items.I tried using default hasher at
src/views/dyn_stack.rs
line 16:pub(crate) type FxIndexSet<T> = indexmap::IndexSet<T, BuildHasherDefault<std::hash::DefaultHasher>>;
but that didn't help.
The text was updated successfully, but these errors were encountered: