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.
This commit is contained in:
committed by
brooklyn!
parent
7eee066c30
commit
240790af60
@@ -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
|
||||
})
|
||||
})
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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 <html> 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
|
||||
|
||||
Vendored
+1
@@ -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 }>
|
||||
|
||||
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user