Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Sources/TinyHand/AppKitHelpers.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
import AppKit

extension NSWindow {
/// When a full-screen Space closes, macOS keeps a hidden window that can join all
/// Spaces only on the current Space, and showing it again does not undo that.
/// Removing the behavior, committing it, and adding it back restores every Space.
func rejoinAllSpaces() {
guard collectionBehavior.contains(.canJoinAllSpaces) else {
return
}
collectionBehavior.remove(.canJoinAllSpaces)
CATransaction.flush()
collectionBehavior.insert(.canJoinAllSpaces)
}
}

extension NSView {
func removeFocusRings() {
focusRingType = .none
Expand Down
2 changes: 2 additions & 0 deletions Sources/TinyHand/OverlayController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,8 @@ final class OverlayController {
tapSound.warm()

CursorHider.hide()
window.rejoinAllSpaces()
toolbar.rejoinAllSpaces()
tick()
window.orderFrontRegardless()

Expand Down
5 changes: 5 additions & 0 deletions Sources/TinyHand/Toolbar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,11 @@ final class Toolbar {
panel.setFrameOrigin(CGPoint(x: screen.frame.midX - f.width / 2, y: screen.visibleFrame.minY + 14))
}

func rejoinAllSpaces() {
panel.rejoinAllSpaces()
tray.rejoinAllSpaces()
}

func show() {
panel.orderFrontRegardless()
panel.invalidateShadow()
Expand Down