From 240790af60071e8528ed2bfc685a4a79ba3d062c Mon Sep 17 00:00:00 2001 From: Brooklyn Nicholson Date: Sat, 29 Aug 2026 00:48:23 -0500 Subject: [PATCH] fix(desktop): let HUD prompts take clicks on solid X11 Ignore-mouse cannot restore on X11, so a visible band that still has pointer-events:none swallows clarify options and links. Held prompts and solid-window bands now take the pointer without composer focus. --- apps/desktop/electron/hud-windowing.test.ts | 2 ++ apps/desktop/electron/hud-windowing.ts | 3 ++ apps/desktop/electron/preload.ts | 1 + apps/desktop/src/app/hud/hud-shell.tsx | 8 ++++- apps/desktop/src/global.d.ts | 1 + apps/desktop/src/styles.css | 36 ++++++++++++++++++++- 6 files changed, 49 insertions(+), 2 deletions(-) diff --git a/apps/desktop/electron/hud-windowing.test.ts b/apps/desktop/electron/hud-windowing.test.ts index 1e4d9b99f8..51cda2719a 100644 --- a/apps/desktop/electron/hud-windowing.test.ts +++ b/apps/desktop/electron/hud-windowing.test.ts @@ -111,12 +111,14 @@ test('the renderer view is a boolean slice of the profile', () => { clientPlacement: false, controlDrag: false, nativeDrag: true, + solid: false, workspaceTransfer: false }) assert.deepEqual(x11, { clientPlacement: true, controlDrag: true, nativeDrag: false, + solid: true, workspaceTransfer: true }) }) diff --git a/apps/desktop/electron/hud-windowing.ts b/apps/desktop/electron/hud-windowing.ts index 8a95b0712e..07f1f3a7ec 100644 --- a/apps/desktop/electron/hud-windowing.ts +++ b/apps/desktop/electron/hud-windowing.ts @@ -37,6 +37,8 @@ export interface HudWindowingView { clientPlacement: boolean controlDrag: boolean nativeDrag: boolean + /** The OS window cannot punch click-through holes (Linux X11). */ + solid: boolean workspaceTransfer: boolean } @@ -128,6 +130,7 @@ export function hudWindowingView(windowing: HudWindowing): HudWindowingView { clientPlacement: windowing.clientPlacement, controlDrag: windowing.controlDrag, nativeDrag: windowing.move === 'native-drag', + solid: windowing.input === 'solid', workspaceTransfer: windowing.workspaceTransfer } } diff --git a/apps/desktop/electron/preload.ts b/apps/desktop/electron/preload.ts index 7e5526c00e..1a3fac1f9c 100644 --- a/apps/desktop/electron/preload.ts +++ b/apps/desktop/electron/preload.ts @@ -84,6 +84,7 @@ contextBridge.exposeInMainWorld('hermesDesktop', { clientPlacement: hudWindowing?.clientPlacement !== false, controlDrag: hudWindowing?.controlDrag === true, nativeDrag: hudNativeDrag, + solid: hudWindowing?.solid === true, workspaceTransfer: hudWindowing?.workspaceTransfer === true }, open: request => ipcRenderer.invoke('hermes:hud:open', request), diff --git a/apps/desktop/src/app/hud/hud-shell.tsx b/apps/desktop/src/app/hud/hud-shell.tsx index 09958d664d..1d0d4cdd4a 100644 --- a/apps/desktop/src/app/hud/hud-shell.tsx +++ b/apps/desktop/src/app/hud/hud-shell.tsx @@ -377,7 +377,11 @@ export function HudShell() { // growth bug); the handle is the one sanctioned way to change size, driving // the same flip-resizable-for-the-call pattern the pet overlay uses. const { resizing: hudResizing, onPointerDown: onHudResizePointerDown } = useHudResizeHandle() - const resizeDirections = hudResizeDirections(window.hermesDesktop?.hud?.windowing?.clientPlacement !== false) + const hudWindowing = window.hermesDesktop?.hud?.windowing + const resizeDirections = hudResizeDirections(hudWindowing?.clientPlacement !== false) + // Linux X11 cannot ignore-mouse; a visible band that also ignores the + // pointer just eats the click. The stylesheet keys off this. + const hudInput = hudWindowing?.solid ? 'solid' : 'click-through' // Force the HOST layers transparent. index.html's pre-paint script writes an // opaque themed background onto as an INLINE style (the anti-white- @@ -399,6 +403,8 @@ export function HudShell() { className="relative flex h-screen w-screen flex-col overflow-hidden" data-hud-edge={edge} data-hud-game={gameUnder ? '' : undefined} + data-hud-held={held ? '' : undefined} + data-hud-input={hudInput} data-hud-recent={recent || held ? '' : undefined} data-hud-shell // Letting go of the composer re-arms the hold, so the transcript steps diff --git a/apps/desktop/src/global.d.ts b/apps/desktop/src/global.d.ts index bb09b46c48..66e79acb32 100644 --- a/apps/desktop/src/global.d.ts +++ b/apps/desktop/src/global.d.ts @@ -101,6 +101,7 @@ declare global { clientPlacement: boolean controlDrag: boolean nativeDrag: boolean + solid: boolean workspaceTransfer: boolean } open: (request?: { sessionId?: null | string; profile?: null | string }) => Promise<{ ok: boolean }> diff --git a/apps/desktop/src/styles.css b/apps/desktop/src/styles.css index 00b9c88af1..c0583524d3 100644 --- a/apps/desktop/src/styles.css +++ b/apps/desktop/src/styles.css @@ -2846,6 +2846,37 @@ button[data-slot='aui_msg-reactions'] svg { pointer-events: auto; } +/* A held band is the interface — clarify / approval / a live turn. It must + take clicks even if the composer never received focus. On click-through + hosts that is a deliberate dead zone over the game; on a prompt it is a + surface you cannot use. */ +[data-hud-shell][data-hud-held] [data-slot='composer-bounds'] { + pointer-events: auto; +} + +/* Linux X11 is a solid window: ignore-mouse cannot restore, so a visible + band that still has pointer-events:none swallows the click and does + nothing. Once the band is up it is the surface. */ +[data-hud-shell][data-hud-input='solid'][data-hud-recent] [data-slot='composer-bounds'] { + pointer-events: auto; +} + +/* Widgets and links opt in even when the band is a ghost, so a click-through + HUD can still answer a clarify option or open an OAuth URL without sitting + in the composer first. Children inherit auto from these roots. */ +[data-hud-shell] + :is( + [data-slot='clarify-inline'], + [data-clarify-choices], + [data-clarify-batch], + [data-slot='tool-approval-inline'], + [data-slot='tool-approval-fallback'], + [data-slot='tool-approval-actions'], + a[href] + ) { + pointer-events: auto; +} + /* Three states, not two. A turn landing brings the transcript up, but only part way — it is there to be glanced at over whatever you are actually doing, and full-strength text over another app reads as the HUD demanding attention it @@ -3466,11 +3497,14 @@ html:has([data-hud-shell]) [data-slot='popover-content'] [class*='max-h-'] { max-height: max(5rem, calc(100dvh - 9rem)) !important; } -/* The menu panels themselves: never taller than the window minus the bar. */ +/* The menu panels themselves: never taller than the window minus the bar. + Portalled out of the shell, they must still take the pointer — the HUD + defaults to none and a right-click menu that cannot be clicked is dead. */ html:has([data-hud-shell]) [data-slot='dropdown-menu-content'], html:has([data-hud-shell]) [data-slot='popover-content'] { max-height: calc(100dvh - 4.5rem) !important; overflow-y: auto; + pointer-events: auto; } /* Hide the scrollbar — a HUD with a visible track stops reading as an overlay. */