forked from Blendman974/faceclaw
[verified] fix(evenhub): preserve app hold gestures without forcing host menu
This commit is contained in:
1 parent
bd630845b6
commit
7c71729d83
4 files changed
+130
-25
No files matched your search
@@ -40,6 +40,8 @@ export type InProcessWindowOptions = {
|
||||
* has no menu of its own, and tap-then-hold opens the system menu instead.
|
||||
*/
|
||||
menuItems?: () => MenuItem[];
|
||||
/** False lets the base app handle the canonical app-menu gesture instead. */
|
||||
openMenuOnAppGesture?: () => boolean;
|
||||
/** Dedicated chat gestures: click menu, hold microphone, tap-hold system menu. */
|
||||
holdToTalk?: boolean;
|
||||
isVoiceCapturing?: () => boolean;
|
||||
@@ -201,12 +203,11 @@ export function createInProcessWindow(options: InProcessWindowOptions): InProces
|
||||
if (closedMenu) requestRender();
|
||||
return;
|
||||
}
|
||||
// The default tap-then-hold response: the window menu (or the system
|
||||
// menu in its place). Handled here (not per-layer) so it works over
|
||||
// submenus and app content alike. A plain long-press never arrives:
|
||||
// the shell keeps it for the system menu (no in-process window claims
|
||||
// it).
|
||||
if ((!options.holdToTalk && event.type === "short-then-long-press") ||
|
||||
// In-process apps normally use the canonical app-menu gesture for the
|
||||
// window menu. An app owning that gesture can opt out dynamically and
|
||||
// receive it through its layer stack instead.
|
||||
if ((!options.holdToTalk && event.type === "short-then-long-press" &&
|
||||
(options.openMenuOnAppGesture?.() ?? true)) ||
|
||||
(options.holdToTalk && event.type === "click" && stack.isAtBase())) {
|
||||
openWindowMenu();
|
||||
await render(frameId);
|
||||
|
||||
Reference in new issue
Block a user