diff --git a/SPEC.md b/SPEC.md index a7b9fba..2b78b7c 100644 --- a/SPEC.md +++ b/SPEC.md @@ -103,7 +103,7 @@ bin/omacast bash CLI → omarchy-shell omacast (socket), plu How the rest of this spec maps onto it: - **§3 IPC.** There is no wire protocol between UI and backend; both live in one QML engine. The *method surface* stays: services register `namespace.method` handlers in one registry (`core/Rpc.js`), using Raycast's names (§3.4). `call()` returns a Promise and `callSync()` returns `{ok,data|error}`. Notifications (`window.visibilityChanged`, `settings.generalSettingsChanged`) go through `subscribe()`/`emit()`. External callers use `ShellIpc` (`omacast call `). The NDJSON host↔backend contract and supervisor (§3.3) are **deferred to Phase 5**: only Raycast extensions need Node, and they will run as a supervised child `Process` that speaks §3.3/§9.2. - **§4 platform.** Omarchy = Hyprland, so Phase 0 targets Hyprland only. Its config is **Lua** (`hyprland.lua`, `o.bind(...)`, `hl.dsp.global(...)`), not `.conf`. -- **§5.1 window.** It uses Omarchy's `OverlayWindow`: a fullscreen transparent layer surface with exclusive keyboard focus, and the 750×475 card drawn inside it. Clicking outside the card counts as focus loss. The surface is mapped fresh on every open, which is how Omarchy avoids stale surfaces when monitors change. +- **§5.1 window.** It uses Omarchy's `OverlayWindow`: a fullscreen transparent layer surface with exclusive keyboard focus, and the 750×475 card drawn inside it. Clicking outside the card counts as focus loss. The surface stays mapped between opens; it is remapped when it moves to another monitor or its monitor goes away, and a launcher open on a lost monitor closes [D]. - **§6 data.** Persisted state is one versioned JSON document per store under `$XDG_DATA_HOME/omacast/db/` (`core/Migrate.js`: numbered migrations, history, atomic writes, never overwrite an unreadable or newer file). There is **no encryption at rest** and no libsecret key: Qt's FileView has no cipher, and full-disk encryption is the Omarchy default. If a store outgrows JSON (clipboard history, file index), revisit with Qt's built-in `QtQuick.LocalStorage` (SQLite) before adding a native dependency. - **§10 frontend.** QML instead of React, with themes from Omarchy's tokens. The 8 Raycast themes (§10.4) become optional palettes over the same tokens. - **Logging** goes to the shell's log (`qs log -n -p "$OMARCHY_PATH/shell"`, lines prefixed `[omacast]`), with the level from `config.json`. There are no separate log files. diff --git a/ui/LauncherWindow.qml b/ui/LauncherWindow.qml index 1071842..96b3b08 100644 --- a/ui/LauncherWindow.qml +++ b/ui/LauncherWindow.qml @@ -41,7 +41,8 @@ PanelWindow { // The surface stays mapped once opened: hidden, it is fully transparent, // takes no input and no keyboard. Mapping a new surface costs ~130 ms (the // output's size and scale arrive a few frames late); flipping these is one - // commit. It is remapped only to move to another monitor. + // commit. It is remapped to move to another monitor, or after its monitor + // goes away. property bool mapped: false visible: window.mapped screen: window.pinnedScreen @@ -255,6 +256,18 @@ PanelWindow { else { popTimer.interval = seconds * 1000; popTimer.restart() } } + // A lost monitor takes the surface but not `shown`, so the "omacast" submap + // would keep every global bind dead. Unmap so the next open maps a fresh + // surface, and close rather than follow focus to another monitor [D]. + Connections { + target: Quickshell + function onScreensChanged() { + if (Quickshell.screens.indexOf(window.pinnedScreen) >= 0) return + window.mapped = false + if (window.shown) window.dismissRequested() + } + } + // Where the card is while open, for Superwhisper: its recording glow (or // pill) then draws on the launcher, as on any focused window, instead of on // the window under it. Idle without Superwhisper or PyGObject.