Skip to content

Commit 7520bc9

Browse files
refactor(desktop): replace get-windows and uiohook-napi, isolate xa11y
get-windows brought node-pre-gyp, a GitHub-downloaded Windows addon, and an ad-hoc-signed Mach-O spawned per capture, for one function. The snapshot service now resolves the foreground window itself: a short osascript JXA lookup on macOS and seven Win32 calls through the ffi-rs loader we already ship on Windows. uiohook-napi installed a system-wide keyboard hook from a single-maintainer package for the Windows modifier-pair shortcut. The forked listener now polls GetAsyncKeyState at 20 Hz, mirroring the macOS design. xa11y no longer loads in the main process. Windows region capture runs in a forked RegionSnapShotWorker with a warm standby and a deadline, and the in-process UIA focus fallback is gone; the worker thread covers that path. WindowsWindowIcon.ts is dropped in favour of app.getFileIcon, which was already the fallback. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
1 parent e4c5de0 commit 7520bc9

27 files changed

Lines changed: 1052 additions & 1703 deletions

apps/desktop/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,8 @@
2828
"electron-store": "^8.2.0",
2929
"electron-updater": "^6.6.2",
3030
"ffi-rs": "1.3.2",
31-
"get-windows": "9.3.0",
3231
"playwright-core": "1.60.0",
33-
"react-grab": "^0.1.32",
34-
"uiohook-napi": "1.5.5"
32+
"react-grab": "^0.1.32"
3533
},
3634
"devDependencies": {
3735
"@effect/vitest": "catalog:",

apps/desktop/scripts/dev-electron.mjs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ const requiredFiles = [
2626
"dist-electron/electron/WindowsForegroundFocusWorker.cjs",
2727
"dist-electron/preload.cjs",
2828
"dist-electron/snapShot/GlobalShiftShortcutWorker.cjs",
29+
"dist-electron/snapShot/RegionSnapShotWorker.cjs",
30+
"dist-electron/snapShot/SnapShotAccessibilityWorker.cjs",
2931
"../server/dist/bin.mjs",
3032
];
3133
const watchedDirectories = [
@@ -36,7 +38,11 @@ const watchedDirectories = [
3638
},
3739
{
3840
directory: "dist-electron/snapShot",
39-
files: new Set(["GlobalShiftShortcutWorker.cjs"]),
41+
files: new Set([
42+
"GlobalShiftShortcutWorker.cjs",
43+
"RegionSnapShotWorker.cjs",
44+
"SnapShotAccessibilityWorker.cjs",
45+
]),
4046
},
4147
{ directory: "../server/dist", files: new Set(["bin.mjs"]) },
4248
];

0 commit comments

Comments
 (0)