Repository navigation
Rejoin all Spaces when the pointer turns on - #30
Open
jorgenbruntveit wants to merge 1 commit into
Open
jorgenbruntveit wants to merge 1 commit into
jorgenbruntveit wants to merge 1 commit into
Conversation
When a full-screen Space closes while the pointer is off, macOS keeps the hidden overlay and toolbar on the current Space only, so the hand no longer shows in other full-screen apps until TinyHand restarts.
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.
Fixes #9.
Problem
After a while the hand stops showing in full-screen apps. The pointer turns on, taps play their sound, but nothing is drawn. It keeps working on the normal desktop, and restarting TinyHand fixes it until it happens again. The log shows the existing re-show attempt failing:
Cause
It happens when a full-screen Space closes, for example when you close a document that was in full screen or take an app out of full screen. If the overlay and toolbar are hidden at that moment (pointer off), macOS keeps them on the current Space only, even though they still have
.canJoinAllSpaces. I checked this withCGSCopySpacesForWindows: the overlay goes from[19, 930, 3](desktop plus two full-screen apps) to[3]. Windows that are visible when the Space closes are not affected.Showing the window again does not undo it, and neither does assigning the same
collectionBehavior, or clearing and re-setting it in one pass. What works is removing.canJoinAllSpaces, letting the change reach the window server, then adding it back.CATransaction.flush()in between is enough.Changes
NSWindow.rejoinAllSpaces()inAppKitHelpers.swiftremoves.canJoinAllSpaces, flushes, and adds it back.OverlayController.activate()calls it on the overlay and on the toolbar panel and ink tray before showing them. The hint panel is created fresh each time, so it does not need it.Testing
Tested on macOS 27.3 with Obsidian and a browser in full screen. I closed a full-screen window while the pointer was off, which reproduces the bug every time, then turned the pointer on. Without the change the overlay and toolbar stay on
[3]and the hand is missing in the full-screen apps. With it they are back on all three Spaces and the hand shows in both apps.Side note: with only Command Line Tools installed,
swift buildfails against the macOS 27.2 SDK because the SwiftUI@Statemacro plugin is missing. I built withSDKROOTpointing at the 26.5 SDK.