Repository navigation
Add native macOS client and host with LAN discovery - #47
acrogenesis wants to merge 16 commits into
Conversation
23fbccd to
23e1497
Compare
|
Cool PR, @acrogenesis! Being able to use Gliff between a Mac and Omarchy is really exciting. One small suggestion for the macOS app: would it be possible to follow Apple's Human Interface Guidelines a bit more closely for the UI? I think it would help Gliff feel more at home on macOS and blend in with the rest of the system. I put together a quick mockup (made with Claude) of how the Nearby Computers picker could look:
Of course this is just an idea, and I totally understand if it's out of scope for this PR or better suited as a follow-up. Thanks again for all the work! |
|
thanks @rx7x12 I improved the design. works dark mode now too. |
|
hey @dhh does omacom have an apple developer account? to publish/sign apps? |
|
i guess this supersedes https://github.com/teomurgi/mac-gliff |
|
Nice work on this. In case it is useful for the viewer side: the Mac viewer here decodes with
At 3440x1440 Dual420 on an M5, decode plus recombine takes about 4.1 ms per frame on average, 4.9 ms at p95. The client around it is the existing GTK client, built on macOS against Homebrew's GTK. The decoder doesn't depend on GTK, though, so it should work behind an AppKit viewer too. Happy to help fit it in if you want it. 🤖 Generated with Claude Code |
Testing feedback: CI build
|
|
Addressed the testing feedback in 792c689:
Validation: Linux 220 tests and Mac 92 Rust tests pass, along with fmt/clippy and the native keyboard, picker, fullscreen and memory checks. A live Mac client displayed a private Linux screen at 2200×1440, scale 2. All five CI checks pass, including Apple Silicon and Intel. The separate nested-headless compositor bug still reproduces against current Aquamarine, 3/3 runs; the patch passes 3/3. Since GitHub refused to reopen #447, the now-vouched replacement is Aquamarine #451. One remaining hardware limitation: the full NVIDIA Linux GPU-decode E2E fails image quality on RTX 5090 / 615.78.08. Fresh diagnostics locate corruption at the VA-API → Vulkan surface import: NVDEC surfaces downloaded and CPU-recombined score 59.5 dB, while the current combined/disjoint NV12 import gives 7.6 dB. Importing the exported Y/UV planes separately as R8/RG8 reads them back byte-for-byte correctly. That diagnostic is not a shipped decoder fix. GPU encoding with CPU decoding passes; the Mac viewer uses that CPU decode path. The focused CPU-viewer E2E passes, but the full hardware suite remains failing. |
|
Fixed the NVIDIA GPU-decoding corruption in 4e992fc. NVDEC was producing correct decoded surfaces, but importing its two separately exported R8/RG88 layers as one disjoint NV12 Vulkan image misread their tiling. The decoder now imports each layer separately as R8/RG8, preserves the exported layout and applies foreign-ownership barriers to both images. Hardware decoding and GPU recombination stay enabled; the shared-object NV12 path is retained.
This resolves the GPU limitation noted in my previous comment. The Aquamarine fix remains a separate prerequisite for nested headless-output tests; no installed compositor libraries or Mac app permissions were changed. |
macOS CI build doesn't start:
|
|
Fixed the packaged-app startup report in ace7645. The picker now uses Also merged current main Validation: 296 Linux tests, 99 Mac tests, fmt/Clippy/native checks and the full GPU-enabled hardware E2E pass. A freshly packaged/extracted 0.4.1 app passes signature verification, native picker inspection/cancellation and actual app executable startup on macOS 27.0.1. The packaged viewer's 240-frame Retina memory check peaks at 116 MiB with zero settled growth. Installed apps, privacy grants and compositor libraries are unchanged. All five CI checks and build artifacts pass on this exact commit, including both Apple Silicon and Intel checks/builds/packages. The downloadable development packages now use version 0.4.1. |
[High impact] The latest documentation change appears safe to merge. SummaryAdds a native macOS viewer and host, LAN discovery, and Mac packaging while keeping SSH as the main transport.
Reviews (4) · Last reviewed commit: "Document native macOS shortcut and fulls..." · Reviewed by Greptile |
|
Two problems I hit running the GTK client from this PR on a Mac against Omarchy, with fixes on my fork in case they help. Tested on an Apple Silicon MacBook Pro, macOS 27.0.1, GTK 4.24.1, libadwaita 1.10.0. My branch is this PR merged with upstream 0.4.1, so the GTK 1. Shortcuts macOS claims never reach the remotemacOS matches its own hotkeys before the app gets the key event, so Fix: while the picture has the keyboard, a HID-level Commit: Unayung@f30f50d 2. The remote's top bar is hard to use in native fullscreenIn native fullscreen, moving the pointer to the top edge slides in the menu bar and the title bar, over the remote's top bar. Returning Fix: on macOS the fullscreen button no longer uses a fullscreen Space. The window turns borderless over the screen area below the camera housing ( Commit: Unayung@c674eeb Happy to rework either one as a PR against your branch if you want them. |
|
Reviewed both reference commits against the current native AppKit client. The GTK focus-controller and fullscreen-button patches do not apply to this branch's Swift window and input routing. The underlying limitations are relevant: reserved macOS shortcuts can be consumed before AppKit receives them, and native fullscreen can reserve the top edge. Documented both limitations in 8a87245 rather than claiming the native client already handles them. Linux scripts/check.sh and the same source's complete macOS 27.0.1 checks pass, including native input/release/fullscreen-resize, keyboard layout, picker and bounded memory checks. These checks do not reproduce the reserved-hotkey or top-edge timing reports. A native adaptation would need explicit keyboard-capture consent, secure-input and release safeguards, plus safe-area handling; the reference patches are useful design evidence for that work. |




Gliff can now view Omarchy from a Mac and view a Mac from Omarchy through the existing SSH transport. Launching Gliff on macOS opens a native Nearby Computers picker; Linux hosts advertise their SSH endpoint through Avahi, and manual SSH addresses remain available.
The change keeps the Linux client and server behind target-specific entry points and adds an AppKit viewer, ScreenCaptureKit capture, CoreGraphics input and lazy text clipboard transfer. Mac hosting runs in a LaunchServices-launched app so Screen Recording and Accessibility grants apply to Gliff. VideoToolbox hardware H.264 is the default on the Mac host, with OpenH264 fallback after startup or runtime failure and an explicit CPU option.
The same change includes the shared app icon, staged Mac installer, development archives and maintainer-owned Developer ID/notarization release tooling. Linux retains main’s 0.4.1 capture modes and fallbacks; Mac viewers negotiate embedded cursors, and both clients retain the cursor and idle-session fixes. Native packet/frame buffering, input release and transport teardown are bounded; temporary pipe-read buffers are drained after each short read, and parallel first-use helper installation is serialized. Linux uses main's integrated NVIDIA plane imports and decoder bounds checks; unsupported imports retain the existing CPU fallback.
The development TCP listener shares Linux's loopback-only policy and requires explicit
--allow-remotefor network exposure. SSH fallbacks run through/bin/sh, command-line aliases retain their configured SSH ports, and discovered selections retain their advertised ports. Mac network writes use a bounded task and write deadlines so stalled video cannot block input release or disconnect handling; discovery reconfiguration restarts its publisher to apply port changes.The Mac connection picker incorporates rx7x12’s layout suggestion and testing feedback. It is a compact standalone window with system appearance/accent colors, computer icons, inline SSH fields and native controls. The window opens at its content-fitting minimum, shows up to four computer rows before scrolling and preserves a window you enlarge. Tab changes focus; Return connects and Escape cancels.
The picker offers Mirror screen or Private screen, remembered independently for each SSH address and port. Mirror remains the initial default and preserves the host screen's proportions. Private creates a separate Linux desktop following the Mac window. Retina size limits preserve aspect ratio and logical pointer coordinates, and fullscreen/backing changes update the remote viewport.
Mac clients now export the active Unicode keyboard layout to Hyprland, including German Y/Z, umlauts, Shift/Caps Lock, Option symbols and common dead keys. Input-source changes update the session keymap. Mac hosts continue using their active local layout; input-method composition and custom multi-character keys remain outside the initial scope.
Screenshots
Nearby Computers on macOS
Dark appearance
Native Mac client viewing Omarchy
A live SSH session showing a dedicated Omarchy terminal on a private output.
Omarchy client viewing the Mac desktop
The clean Mac Space mirrored over SSH.
Validation
efc8c8a, including macOS 15 Apple Silicon/Intel native checks, release builds and development packages. The merge includes all changes from main58c7424(0.4.1), including upstream NVIDIA imports, bounded decoders, capture/output handling, input fixes and clipboard changes. The Linux UI is kept in its target-specific module; the duplicate branch NVIDIA implementation was removed in favor of main's integrated version.scripts/check.sh, formatting, Clippy with warnings denied and 300 tests pass (one existing ignored). Linux release build, Bash syntax and warning-level ShellCheck pass.GLIFF_REQUIRE_HARDWARE_ENCODER=1 scripts/check.sh, formatting, Clippy, 105 tests and native reader/input/layout/picker checks pass. Mac release build and development packaging pass.ace7645, a newly built 0.4.1 development archive was extracted and its bundle signature verified. The actual bundledgliff-native chooseopens, answers inspection and cancels cleanly, without the own-suite warning. The actualContents/MacOS/gliffexecutable starts and keeps its picker alive. Tests use a separate extracted app; installed apps and privacy grants are unchanged.ace7645, full GPU-enabledscripts/e2e.shpassed on RTX 5090/NVIDIA 615.78.08: Vulkan Video encoding, Dual420/Single420 and mixed CPU/GPU quality checks, capture, mirror resize/forced CPU capture fallback, rotation, odd-sized captures, text/binary/file clipboard, input-method keymap switching and shortcut inhibition. No CPU-viewer override or excluded GPU cases. The nested compositor uses the private Aquamarine format fix; installed libraries/configuration are unchanged.163b138on October 22. ItsHeadless.cppexactly matches the previously tested patch. The October 19 comparison reproduced the original 0x0/GBM failure in three of three runs and passed actual capture/encode/decode with the fix in three of three runs.Earlier live-session checks, predating this main merge:
Before general release
General release is pending the following checks:
The documented initial Mac scope is CPU viewer decoding, text-only clipboard and mirror hosting. Automatic LAN discovery currently finds Linux hosts from the Mac picker. Private Mac outputs, automatic reconnect and Linux discovery of Mac hosts are follow-up work.
The companion OPR recipe PR #1009 adds the PNG/discovery payload for Linux packaging. This branch inherits the 0.4.1 workspace version from main.