extras
Goal
The remaining PowerToys behaviours that are neither input routing nor
clipboard: keeping the other machines' screens awake while the user
is active here (BlockScreenSaverOnOtherMachines), not switching away
by edge while a fullscreen app has the foreground
(DisableEasyMouseWhenForegroundWindowIsFullscreen + excluded apps),
drawing a cursor on a controlled Mac so the user can see where the
remote pointer is (DrawMouseCursor/DrawMouseEx), plus finishing two
paths that exist but were never verified end-to-end
(BlockMouseAtScreenCorners, MoveMouseRelatively with NextMachine)
and the clipboard-transfer notifications app-ui still owes. This lane
ends at CP3, after which the app is feature-complete against the
PowerToys module minus README D6.
Assumptions
- Awake (
Receiver.cs:245-248→Common.HumanBeingDetected,Common.cs— read it: on Windows it nudges the system idle timer /SetThreadExecutionState). On a Mac that is being controlled, eachAwake (21)packet renews anIOPMAssertionCreateWithName( kIOPMAssertionTypePreventUserIdleDisplaySleep, …)with a 90 s timeout (IOPMAssertionTimeoutKey) so the display stays on while the remote user is active and the assertion lapses on its own when theAwakes stop (60 s cadence, §3.3). A plainHeartbeatdoes not renew.IOKitis imported only inMWBMac/Awake.swift. Nothing is asserted whenBlockScreenSaverOnOtherMachinesis off on the receiving side? — No: Windows applies the sender's setting (it decides whether to sendAwake); the receiver always honours it. Port that. - Fullscreen rule (
Common.csIsForegroundWindowFullscreen— find it and the excluded-apps check, cite): before an edge switch (not a hotkey switch) the Engine asksFullscreen.frontmostIsFullscreen(), which takesNSWorkspace.shared.frontmostApplication, skips it if its bundle identifier or localized name is inEasyMouseFullscreenSwitchBlockExcludedApps(case-insensitive, asStringComparer.OrdinalIgnoreCase), and otherwise checks whether that app has an on-screen window whose bounds equal a display's bounds, viaCGWindowListCopyWindowInfo(.optionOnScreenOnly)filtered bykCGWindowOwnerPID— bounds are available without Screen Recording permission; window names are not read. Cached for 250 ms so an edge storm does not query per event. When true, the edge candidate is ignored (Switcher.crossingis not called). - Drawn cursor (
Class/CustomCursor.cs,Common.csDrawMouse…,Form/frmScreen.cs— read which machine draws and when; cite): on the Mac being controlled, whenDrawMouseCursoris on, a borderless, transparent, click-throughNSWindow(level = .screenSaver,ignoresMouseEvents,collectionBehavior = [.canJoinAllSpaces, .stationary]) shows a standard arrow image at the last injected position and hides when control leaves.DrawMouseExon Windows selects the richer drawing path; here it is accepted and ignored (say so). The overlay is driven fromInjector's posted moves via a callback the Engine wires; never from the tap. Settings.drawMouseCursoraccessor added toMWBCore/Settings.swift(authorised; app-ui's open request) and the toggle added toBehaviourPane.swift(authorised) in the position PowerToys shows it.- Corners and relative mode: read
Engine.considerCrossing,Engine.reportEdgeToController, the.nextMachinedispatch case,Edge,Coordinatesand the tap's relative-move encoding, and confirm againstMachineStuff.cs:203-283,Receiver.cs:145-172,Common.cs:516-539,InputHook.cs:311-312that both settings work end-to-end; fix gaps with cited, minimal edits (authorised inEngine.swift/EngineActions.swiftfor those paths only) and record what was verified by reading in the Work log. - Transfer notifications (clipboard's open request): when
ShowClipboardAndNetworkStatusMessagesis on,UIBridgepostsNotifiermessages for clipboard received/sent/failed using the textClipboardAction.notealready carries (authorised edit ofUIBridge.swift, that path only). - Permissions: none of this needs a new TCC grant. IOKit
assertions,
CGWindowListbounds and overlay windows need nothing.
Handshakes
Consumed
app-engine:Enginedispatch for.awake, the edge path, the injector callback;Settingsaccessors.input-inject: aInjector.onPointerMovedhook if one exists — if not, the Engine already knows every injected position and forwards it to the overlay (prefer that; no Injector edit).app-ui:Notifier,BehaviourPane.
Promised (to polish)
public final class DisplayAwake { func renew(seconds: TimeInterval); func release() } // MWBMac/Awake.swift
public enum Fullscreen { static func frontmostIsFullscreen(excluding: Set<String>) -> Bool }
@MainActor public final class CursorOverlay { func show(at: CGPoint); func move(to: CGPoint); func hide() }
Status / TODO
Sources/MWBMac/Awake.swift+ Engine.awakehook (Receiver.cs:245-248,Common.csHumanBeingDetected).Sources/MWBMac/Fullscreen.swift+ edge-path hook + excluded apps (Common.csIsForegroundWindowFullscreen and callers).Sources/MWBCore/Settings.swiftdrawMouseCursoraccessor;Sources/MWBMac/SettingsWindow/BehaviourPane.swifttoggle.Sources/MWBMac/FakeCursor.swift+ Engine wiring (CustomCursor.cs,frmScreen.csdrawing path).- Corners + relative mode verified end-to-end by reading; gaps fixed
(
Sources/mwb/Engine.swift,EngineActions.swift, authorised). Sources/mwb/UIBridge.swift: clipboard transfer notifications.docs/protocol.md: append §10.8 with anything learned, cited.- Checkpoint CP3 is the lead's after merge.