Commit 2adf248
committed
fix(ui): addKeyboardShortcut codegen drops 3-arg calls (modifiers slot missing)
The PERRY_UI_TABLE entry for addKeyboardShortcut declared only 2 args
(Str + Closure), but the runtime FFI takes 3 (key, modifiers, callback)
and every documented example uses the 3-arg form. lower_perry_ui_table_call
hits its arity-mismatch fallback at lower_call.rs:5327 and silently
returns 0.0 — no menu item is installed and no shortcut fires.
Add the missing UiArgKind::F64 modifier slot so codegen, runtime, and
docs all line up. Also update types/perry/ui/index.d.ts to declare the
3-arg form with a doc comment for the modifier bitmap (1=Cmd, 2=Shift,
4=Option, 8=Control), matching the macos/gtk4/windows runtime
implementations.
Verified by recompiling perry-pry: all 7 keyboard shortcuts (Cmd+L,
Cmd+F, Cmd+1, Cmd+2, Cmd+I, Cmd+V, Escape) now appear in the app
menu and their callbacks fire on key press, where previously the
app menu only showed the default Quit item.1 parent e5bc172 commit 2adf248
2 files changed
Lines changed: 17 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5146 | 5146 | | |
5147 | 5147 | | |
5148 | 5148 | | |
| 5149 | + | |
5149 | 5150 | | |
5150 | | - | |
| 5151 | + | |
5151 | 5152 | | |
5152 | 5153 | | |
5153 | 5154 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
521 | 521 | | |
522 | 522 | | |
523 | 523 | | |
524 | | - | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
525 | 539 | | |
526 | 540 | | |
527 | 541 | | |
| |||
0 commit comments