forked from Blendman974/faceclaw
Allow backgrounding EvenHub apps
This commit is contained in:
1 parent
cde29cc4d0
commit
b9f48c8e16
10 files changed
+376
-252
No files matched your search
@@ -101,7 +101,19 @@ export function createInProcessWindow(options: InProcessWindowOptions): InProces
|
||||
// items act on the shell directly (workers post messages instead).
|
||||
const openWindowMenu = () => {
|
||||
if (stack.topMatches((layer) => layer instanceof WindowMenuLayer)) return;
|
||||
const items: MenuItem[] = [...(options.menuItems?.() ?? [])];
|
||||
// "Focus app switcher" first: long-press then tap defocuses the app
|
||||
// (hands focus to the sidebar) without closing it — the reliable way out
|
||||
// for apps that consume double-click.
|
||||
const items: MenuItem[] = [
|
||||
{
|
||||
label: "Focus app switcher",
|
||||
onSelect: (ctx) => {
|
||||
ctx.stack.pop();
|
||||
shell.yieldFocusToSidebar();
|
||||
},
|
||||
},
|
||||
...(options.menuItems?.() ?? []),
|
||||
];
|
||||
items.push({
|
||||
label: "Voice input",
|
||||
onSelect: (ctx) => {
|
||||
|
||||
@@ -86,6 +86,14 @@ export function defaultWindowMenuItems(
|
||||
post: (reply: WorkerAppReply) => void,
|
||||
): MenuItem[] {
|
||||
return [
|
||||
{
|
||||
// Defocus the app (hand focus to the sidebar) without closing it.
|
||||
label: "Focus app switcher",
|
||||
onSelect: (ctx) => {
|
||||
ctx.stack.pop();
|
||||
post({ type: "yield-focus", windowId });
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "Voice input",
|
||||
onSelect: (ctx) => {
|
||||
|
||||
Reference in new issue
Block a user