Add macOS support#17
Open
laveez wants to merge 14 commits into
Open
Conversation
- Move smithay/wayland/calloop/dbus to a Linux-only target dependency table - Relocate the Wayland event loop verbatim to src/backend/wayland.rs (Linux only) - Slim main.rs to the shared CLI + cfg backend selection; macOS uses a stub pending the native backend
- Defaults (primary, while-active) preserve current Linux behavior - Backward compatible: configs without [activation] deserialize to defaults - Parsing unit-tested on macOS
- Pure event->command machine (idle/resume/dismiss/signal/quit) with dismiss + resume graces - Encodes the activation + keep_awake policy; 6 unit tests, no display required
- Route idle/resume/input/signal events through Engine::handle and apply its commands - Engine now owns the 1s dismiss and 5s resume graces (removed from the Wayland loop) - No behavior change for the default policy; the idle inhibitor stays bundled in activate/deactivate
- Split surface creation out of Compositor::new; cfg(linux) new_wayland keeps the Wayland path - Compositor core now compiles on macOS (verified); each backend picks the wgpu Backends
…erer) - winit fullscreen window + wgpu(Metal) surface feeding the portable Compositor - AlwaysOnTop window level so the saver shows and the surface is not occluded - Idle detection, the IOPMAssertion keep-awake, and Engine wiring come next
…ather - One fullscreen window + Compositor per monitor - Hide the cursor over the saver; start the weather fetch thread
…kend - Poll CGEventSource idle and drive the Engine: idle->show, input->hide, persist - Hold a PreventUserIdleDisplaySleep assertion (the OLED-stays-awake / HDMI fix) - Respect the activation policy (all/primary); release the assertion on exit
- Request the adapter's real limits so surfaces above 8192px (e.g. a 2x panel) are allowed - Clamp the surface to the GPU max as a proportional safety net
- NSScreenSaverWindowLevel + all-Spaces / over-fullscreen via objc2 (AlwaysOnTop fallback) - Hide the cursor globally with NSCursor (fixes the lingering main-screen cursor); restore on dismiss/exit
- Generate a LaunchAgent plist (RunAtLoad + crash-only KeepAlive) from the setup wizard - Run the agent from an LSUIElement app bundle so it has no Dock icon - cfg-split pid_path (macOS uses the per-user temp dir) and make olsvr stop boot out the agent - Write and clean up the PID file in the macOS backend - Add macOS to the CI check matrix
- Size each saver window to the display frame at screen-saver level instead of winit's Fullscreen::Borderless, which an LSUIElement accessory app can't drive - Overscan ~2pt and paint the window opaque black with no shadow so HiDPI rounding leaves no grey seam at the edges
- Note the Wayland + macOS backends, Metal rendering, and launchd login agent - Document the [activation] config (displays, keep_awake) with platform caveats - Split Requirements into Linux (Wayland) and macOS; add a macOS PATH note
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
olsvr now runs natively on macOS alongside Linux/Wayland. On macOS it renders the same fading clock and weather overlay fullscreen on every display, keeps the OLED panel awake, hides the cursor, activates on idle, dismisses on input, and can install itself as a login agent with no Dock icon. Default behavior on Linux is unchanged.
What's included
Enginestate machine +Compositorrenderer) with the Wayland and macOS backends behind acfg-gated seam, so the crate builds on both targets.IOPMAssertionkeep-awake, screen-saver-level windows, and a launchd login agent run from anLSUIElementapp bundle.[activation]config (displays,keep_awake); defaults preserve the original single-display, inhibit-while-active behavior.Why these choices
Engine/Compositorkeep all activation, grace-period, and keep-awake logic platform-independent and unit-tested; each backend only owns its windowing glue.LSUIElement(no-Dock-icon) app cannot drive winit's fullscreen path. This keeps it edge-to-edge as an accessory app.KeepAliveis crash-only (SuccessfulExit=false) to mirror the systemd unit'sRestart=on-failure.Testing
TODO before merge