Fix false positive overlap detection for half/third actions#1766
Open
MyronKoch wants to merge 1 commit into
Open
Fix false positive overlap detection for half/third actions#1766MyronKoch wants to merge 1 commit into
MyronKoch wants to merge 1 commit into
Conversation
Origin-only matching caused false positives when a larger window (e.g. maximized or near-fullscreen) shared the same origin as the target position. Now excludes windows that cover more than 90% of the screen on both axes from overlap detection, while preserving offset behavior for mixed-size grid windows at the same position (e.g. an eighth behind a quarter). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ec1d023 to
38eca47
Compare
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
Fixes the post-merge bug from #1762 where executing a left or right half would add an offset even when there is no underlying window at that position.
Root cause
The overlap detection used origin-only matching (within 4px tolerance). When snapping to left-half at origin (0, 0), any other window on screen with its origin near (0, 0) - such as a maximized window - triggered a false positive.
Fix
Now requires that the other window fits within the candidate's dimensions: origins must match AND the other window must be the same size or smaller. This prevents a maximized window (1920x1080) from triggering the offset on a left-half (960x1080), while still detecting an eighth (480x540) behind a quarter (960x1080) at the same grid position.
Test cases