-
Notifications
You must be signed in to change notification settings - Fork 6.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FanzyZones] Zone activation based on zone center #11361
Conversation
… pixels). Temporary turned off buffer of window selection to better see how the algorithm is working.
POINT center = getCenter(zone); | ||
return pointDifference(center, pt); | ||
}; | ||
auto sensitivity = 75; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, don't use magic numbers. Specify a constant in the namespace at the top of the ZoneSet.cpp
@ulazy1 would it be possible to respond to @SeraphimaZ? Looks like a very interesting PR, she has some questions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
Tested, works well, unit tests passed. The code looks good.
Is there a way to use the "Activate the zone whose center is closest to the cursor" option for two overlapping zones, each of which shares an identical center point? I can make this work by shifting the center point slightly upwards for one of the zones, though I would prefer if the two zones--both centered at the middle of my monitor and both continued to have equal areas left to right and above to below from the center. Without adjusting the size or center point of one of the zones, however, I can only snap to the smaller of the two centered zones. JD |
Hi @caramelized-jd, I suppose that in this particular case you described, another activation method should fit better. Did you try |
Hi SeraphimaZykova, I tried the "Split the overlapped area into multiple activation targets" option and, though it isn't as intuitive as the other options, it does meet my needs. Thanks, JD |
Summary of the Pull Request
I have implemented a new algorithm for dealing with snapping overlapping tiles. What I'm proposing snaps to the tile with the closest center, unless the centers of the tiles are too close in which case it falls back to taking the smallest tile. I still need to add a setting to adjust the level at which the algorithm falls back to taking the smallest tile.
What is include in the PR:
A new setting algorithm to select a zone when they overlap.
Temporarily disabled buffering of windows when selecting.
How does someone test / validate:
Change the "When multiple zones overlap:" setting to "Activate the zone whose center is closest to the cursor" in the Fancy zones settings. Here are some before and after gifs:
Before, split the overlapped area into multiple activation targets:
Now, activate the zone whose center is closest to the cursor:
Before, split the overlapped area into multiple activation targets:
Now, activate the zone whose center is closest to the cursor:
Now, when centers are too close, the algorithm reverts to taking the smallest window:
Quality Checklist
Contributor License Agreement (CLA)
A CLA must be signed. If not, go over here and sign the CLA.