Skip to content
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

Merged
merged 6 commits into from
Jun 16, 2021

Conversation

jwmdykes
Copy link
Contributor

@jwmdykes jwmdykes commented May 19, 2021

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:
gif1
Now, activate the zone whose center is closest to the cursor:
gif2

Before, split the overlapped area into multiple activation targets:
gif3
Now, activate the zone whose center is closest to the cursor:
gif4

Now, when centers are too close, the algorithm reverts to taking the smallest window:
gif5

Quality Checklist

Contributor License Agreement (CLA)

A CLA must be signed. If not, go over here and sign the CLA.

ulazy1 added 3 commits May 19, 2021 02:31
@jwmdykes jwmdykes changed the title Zone activation based on zone center [FanzyZones] Zone activation based on zone center May 19, 2021
@enricogior enricogior added FancyZones-Dragging&UI FancyZone dragging / interaction issue Product-FancyZones Refers to the FancyZones PowerToy labels May 21, 2021
@jwmdykes jwmdykes requested a review from enricogior May 22, 2021 15:23
@jwmdykes jwmdykes marked this pull request as ready for review May 28, 2021 16:05
POINT center = getCenter(zone);
return pointDifference(center, pt);
};
auto sensitivity = 75;
Copy link
Collaborator

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

@crutkas
Copy link
Member

crutkas commented Jun 11, 2021

@ulazy1 would it be possible to respond to @SeraphimaZ? Looks like a very interesting PR, she has some questions

Copy link
Collaborator

@SeraphimaZykova SeraphimaZykova left a 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.

@crutkas crutkas merged commit 482163d into microsoft:master Jun 16, 2021
@jwmdykes jwmdykes deleted the closest-centers branch June 16, 2021 17:19
@caramelized-jd
Copy link

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

@SeraphimaZykova
Copy link
Collaborator

Hi @caramelized-jd, I suppose that in this particular case you described, another activation method should fit better. Did you try Split the overlapped area into multiple activation targets?

@caramelized-jd
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FancyZones-Dragging&UI FancyZone dragging / interaction issue Product-FancyZones Refers to the FancyZones PowerToy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants