Long-press and short-then-long with a context menu open switches between context menus

This commit is contained in:
James Babcock committed 2026-09-01 21:38:52 -07:00
1 parent c364099a8c
commit fddb6ea886
5 files changed
+37

No files matched your search

+8
View File
@@ -185,6 +185,14 @@ export function createInProcessWindow(options: InProcessWindowOptions): InProces
},
drawIcon: options.drawIcon ?? windowIcon(options.icon, options.iconLetter),
handleInput: async (event, frameId) => {
// The shell opened its system menu over this window; close our own
// context menu so the two never stack. Never forwarded to app layers.
if (event.type === "system-menu-opened") {
if (stack.popIfTop((layer) => layer instanceof WindowMenuLayer)) {
requestRender();
}
return;
}
// The default long-press response: the window menu. Handled here (not
// per-layer) so it works over submenus and app content alike.
if (event.type === "long-press") {