Use .onScreen window list for detached emoji popover lookup#90
Open
indent[bot] wants to merge 1 commit into
Open
Use .onScreen window list for detached emoji popover lookup#90indent[bot] wants to merge 1 commit into
indent[bot] wants to merge 1 commit into
Conversation
The retry loop around characterPickerSearchField was enumerating every window owned by every app on the system (.all) up to 20 times per setReaction. Switching to .onScreen lets CG drop off-screen windows before they cross into Swift land, and isCandidateWindow already required isOnscreen == true so semantics are preserved. Generated with [Indent](https://indent.com) Co-Authored-By: KishanBagaria <KishanBagaria@users.noreply.github.com>
Contributor
Author
|
17cbef3 to
e9fc979
Compare
Contributor
|
@KishanBagaria what's stopping this from being merged. |
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.
Summary
CharacterPickerPopover.windowCandidates()fromWindow.listDescriptions(.all, …)to.onScreenso off-screen windows are filtered by Core Graphics before reaching Swift.Motivation
Follow-up to #89. The
retry(withTimeout: 1.0, interval: 0.05)aroundcharacterPickerSearchFieldcallswindowCandidates()~20× persetReactionon the Tahoe detached-popover path. Each call was copying descriptors for every window owned by every app on the system.isCandidateWindowalready requiresdescription.isOnscreen == true, so.onScreenis semantics-preserving and lets CG drop the rest of the windows up front.Testing
No behavior change — covered by the existing reaction flow exercised by #89. The filter predicate is unchanged; only the upstream
CGWindowListCopyWindowInfooption flag flips.Tag
@indentto continue the conversation here.