Repository navigation
Conversation
show() called NSApp.activate(ignoringOtherApps:) before ordering the panel in. With macOS's default "switch to a Space with open windows for the application" setting, activating Pesty while its Settings or Preview window sits on another Space jumps the user to that Space, so the hotkey always landed on Desktop 1. The bar is a .nonactivatingPanel with canBecomeKey, so it takes key focus without activating the app. Drop the activate call. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Problem
With more than one desktop (Space), pressing the hotkey (⌘⇧V) jumps to Desktop 1 instead of opening the Paste Bar on the current desktop.
Cause
BarWindowController.show()callsNSApp.activate(ignoringOtherApps: true)beforemakeKeyAndOrderFront. macOS's "When switching to an application, switch to a Space with open windows for the application" setting is on by default. With it on, activating Pesty while one of its regular windows (Settings, Preview) is open on another Space moves the user to that Space. The bar itself is fine (canJoinAllSpaces), but the activation moves the user away from the Space they were on.Fix
Remove the
activatecall fromshow(). The bar is a.nonactivatingPanelwhosecanBecomeKeyreturnstrue, somakeKeyAndOrderFrontgives it key focus without activating the app. That is the path the existing comment ininit()already relies on for Secure Event Input. Because Pesty is no longer activated, the previously frontmost app stays frontmost, which also suits the paste-back flow.One line changed in
Sources/Pesty/UI/BarWindowController.swift. No visual change to the strip.Testing
swift build: clean.swift test: 39 tests, 0 failures.scripts/build_app.shand installed locally on macOS 27.2. Manual check across Spaces is pending: hotkey on Desktop 2 with Settings open on Desktop 1, then arrows, search, Return to paste, and Esc.Not checked: main-menu key equivalents (for example ⌘Z) while the bar is key and the app is inactive.
🤖 Generated with Claude Code