linebender / linebender/druid

Keyboard shortcuts broken until menu rebuild.

Open
#1,380 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug shell/win
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.