Keyboard shortcuts broken until menu rebuild.
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 9.7k
- Forks
- 565
- PR merge metrics
- No merged PRs in 30d
Description
Reproduction case: https://gist.github.com/bheisler/8939290f15e9c515a94fa6c090c3323c
Platform: Windows
Druid version: Occurs in latest Git revision. I don't know when this behavior was introduced.
On running this test case, a window with a button counter appears. There is also a menu, with a keyboard shortcut of Ctrl-I to increment the counter.
If the user presses Ctrl-I after opening the window, nothing happens. However, if the user navigates through the menu to the Counter->Increment item and clicks that, or presses the Increment button, then the counter will correctly increment. Once the counter has been incremented at least once, the keyboard shortcut works as expected.
Note that if you comment out ctx.submit_command(REBUILD_MENU) on line 44, this "fixing" behavior does not occur and the keyboard shortcut remains broken. It seems as though the menu built by the WidgetAdded handler is broken in some way, and rebuilding the menu fixes it.
I've tried changing the WidgetAdded handler to submit a REBUILD_MENU command but that had no observable effect.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reproduction case at https://gist.github.com/bheisler/8939290f15e9c515a94fa6c090c3323c on Windows, focusing on the WidgetAdded handler and the ctx.submit_command(REBUILD_MENU) call on line 44. Trace why the initial menu's Ctrl-I shortcut is inactive until Counter->Increment or the button is used; done means the shortcut works immediately after the window opens without rebuilding the menu.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100