Cross-platform menu issues (for Runebender)
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 9.7k
- Forks
- 565
- PR merge metrics
- No merged PRs in 30d
Description
I'm doing most my Runebender development on Windows, and have come across some issues related to menus. This is a tracking issue for those.
* The Runebender source uses `platform_menus::mac` menus directly, without any kind of configuration check. Those use `RawMods::Meta`, which bind to Windows, and that doesn't work.
* The shortcuts ("Ctrl-S") are not displayed in Windows menus. I think that was intended for a while, but I didn't quite get around to implementing them. There was churn around `HotKey` but I think that's stabilized reasonably well now thanks to the keyboard work.
* The provided menus are missing alt-key shortcuts. These appear to work, by adding an ampersand in the localized string (`&File`, `E&xit`, etc), and are stripped out (at least on mac, haven't tested Linux yet).
The most expedient fix to the first problem is to switch from `RawMods` to `SysMods::Cmd`. That would result in reasonable behavior if menus for the wrong platform were used, if not the most platform-appropriate keybindings. A deeper change would be to expand the `platform_menus::common` choices, and more aggressively enforce the use of actual platform specific menus.
I have local patches with expedient fixes for most of this, and plan to PR them. I'm open to discussion about the right way to proceed, and of course if people want to take on more extensive rework.
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 by locating Runebender's direct uses of platform_menus::mac, RawMods, SysMods::Cmd, and HotKey. Check the menu behavior on Windows, macOS, and Linux, including displayed Ctrl-S shortcuts and ampersand-based alt-key shortcuts. Done means the menus use appropriate modifiers and show the expected keyboard shortcuts across platforms.
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
- 35/100