microsoft / PowerToys

Windows system utilities to maximize productivity
MIT License
109.53k stars 6.45k forks source link

[FancyZones] Alternative way to snap windows to defined zones #7809

Closed ghost closed 2 years ago

ghost commented 3 years ago

Current situation FancyZones allows users to create custom window layouts. However, some layouts are impossible to create and/or it's impossible then to drag windows to some of the defined areas, because they are not accessible.

Figure 3 shows a standard grid layout which is overlayed by a red rectangular zone in the center. In the current way FancyZones works, this layout is impossible to use, because the grid covers the center zone so that the center zone is inaccessible. Because of the overlapping it is impossible to drag a window to the center zone. So instead of creating one layout like Figure 3, users have to create two separate layouts, one grid layout (Figure 1) and layout with just the red center rectangular field. The user then has to switch between those layouts and only after switching it becomes possible to drag a window to the center zone. But this switching between layouts is time consuming and tedious. It would be better, I think, if those more complex layouts (or other layouts like this) could be used without switching. But this requires a better/enhanced/additional way to move windows to the defined zones.

Feature / improvement request (see Figure 2) In the title bar of a window next to the standard window buttons (Close, Maximize, Minimize) a grid-like FancyZones button should be placed. When clicking on that grid-like button the Popup Panel opens. This Popup Panel panel should show the user-defined grid from Figure 3. Above the grid there are buttons. Each button gets a blue background highlight color when the mouse cursor hovers above them, at the same time the according zone gets a blue highlight color, too, so that the user can see where the window is going to be moved when clicking on the button. (Of course the design needs more fine-tuning, but I hope I could give you an adequate impression of my idea.)

An alternative/modified version could look like this: Instead of showing buttons above the grid, it could be possible to select the fields of the grid with the mouse and upon releasing the mouse button the window gets moved to the selected area.

Instead of having a grid button, the Popup Panel could also be invoked by right clicking on the title bar or one of the standard window buttons and/or using a (keyboard) hotkey.

Benefits

Figures

Figure 1

Figure 2

Figure3

Jay-o-Way commented 3 years ago

Sorry if I am mistaken, but this looks like a simple 3x2 grid to me. You can hold ~Shift~ CTRL and drag to select multiple zones.

ghost commented 3 years ago

There is a Macintosh App out there that "kind of" does what I have in mind, but not as flexible as my solution. https://manytricks.com/moom/ Please have a look at their flexible drag'n'drop grid.

Jay-o-Way commented 3 years ago

Sorry, what I had to say was to use the Ctrl key while dragging to select multiple zones, for example zones 1+2+3. So yes, it is possible.

ghost commented 3 years ago

Sorry, what I had to say was to use the Ctrl key while dragging to select multiple zones, for example zones 1+2+3. So yes, it is possible.

Cool, I did not know that. Thanks for telling me! (Note to myself: RTFM!)

But is it possible to create a layout like Figure 3? Please help!

Jay-o-Way commented 3 years ago

Cool, I did not know that. Thanks for telling me! (Note to myself: RTFM!)

It happens. No hard feelings.

But is it possible to create a layout like Figure 3? Please help!

I still would say yes. Try to create a new layout with 7 (floating) zones. image

They overlap in this example because I made it quickly, but you can tweak/edit the zones.

ghost commented 3 years ago

I tried your 7 floating zones solution, but I was only able to move a window to the fields 1-6 (and any combination of them), field 7 did not work, because it behaves like being "behind" the fields 1-6.

Jay-o-Way commented 3 years ago

You're right on that. Overlapping zones are still conflicting/unreachable. I tried with some changes in the zones-settings.json file (in %USERPROFILE%\AppData\Local\Microsoft\PowerToys\FancyZones) and the "floating" zone is never reachable, unless I create a significant gap between the other overlapping zones. As mentioned in #3362

Also noticed a different problem: When dragging and hovering with the mouse cursor over a border between two adjacent (touching) zones, you should see both "light up". The window will be in both zones when you drop it. But when the cursor is in a place that is both on a border and on the area of the "unreachable" zone (even if that behaves as if on the background) it will not work to drop the window on both of the zones.

CC @crutkas

enricogior commented 3 years ago

I don't think that any of the proposed solutions to solve the priority of overlapping zones fixes all the cases. I think it would be much better to choose the most promising strategies and allow the users to decide which one is working better for their layouts via a settings option.

just1a-person commented 3 years ago

Now this is built-in to Windows 11. Yay!

phazzzy commented 3 years ago

But is it possible to create a layout like Figure 3? Please help!

@Marrib, You can set the sensitivity to a negative value to access the overlapped area in %USERPROFILE%\AppData\Local\Microsoft\PowerToys\FancyZones\zones-settings.json file.

This hack may not always work, but it does work for now.

https://user-images.githubusercontent.com/26648228/125187376-c8d72e00-e248-11eb-9793-80726ad30419.mp4

Jay-o-Way commented 3 years ago

Now this is built-in to Windows 11. Yay!

When I saw this in a YouTube video, I thought "Yeah, but that's basically taken from PowerToys, so made by volunteers. You're welcome for the effort, Microsoft"

Jay-o-Way commented 3 years ago

@Marrib there have been a number of updates in the mean time. Especially for the priority of overlapping zones, and choosing/applying different layouts. The button in the title bar is a great idea, but I can't judge the feasibility - at least for Win.10. Can you try the latest version and then tell us what's in this issue that you think still needs attention?

phazzzy commented 3 years ago

@Jay-o-Way

Can you try the latest version and then tell us what's in this issue that you think still needs attention?

In my opinion, this issue describes two different problems:

1) Ability to snap a window to several zones at the same time. In my case, this is not of interest and is partially solved by switching to Win 11. Although there, you can only choose one of the ready-made options. It would be nice to be able to see a custom grid in the pop-up window, for example 9×6, and select with the cursor those columns or rows into which the window should stretch.

2) Inability to choose an zone that is overlapped by others. In 0.41.4 version this problem is not solved in any way. The only option that helped me was to set the sensitivity to a negative value. This can be done by editing the file, but this option is not provided in the interface. This works in my zones layout, but this is just a special case. A good idea for rethinking activation zones was suggested in issue #11009. I think this should happen automatically and smart: place smaller ones higher in Z and automatically determine the sensitivity for shrinking or stretching the boundaries of the zone so that it is always available.

Jay-o-Way commented 3 years ago
  1. Ability to snap a window to several zones at the same time.

You can select multiple zones when you're dragging a window and hold down Ctrl. Is that not the solution to your issue?

  1. Inability to choose an zone that is overlapped by others.

Does this setting not allow you to choose?

image

phazzzy commented 3 years ago

You can select multiple zones when you're dragging a window and hold down Ctrl. Is that not the solution to your issue?

Yes it works! I, as well as the author of the issue, did not know about such a possibility. I also read the comments inattentively.

Does this setting not allow you to choose?

Oh, sorry! I didn't see these settings when I tried to achieve the behavior I wanted. This option came out a couple of weeks ago. Perhaps I tried on an older version where it was not.

Thank you, in my case this is enough!

ghost commented 3 years ago

You can set the sensitivity to a negative value to access the overlapped area in %USERPROFILE%\AppData\Local\Microsoft\PowerToys\FancyZones\zones-settings.json file. This hack may not always work, but it does work for now.

Works for me, too, but I think this is not a very convenient way and sometimes indeed not very reliable.

ghost commented 3 years ago

When I saw this in a YouTube video, I thought "Yeah, but that's basically taken from PowerToys, so made by volunteers. You're welcome for the effort, Microsoft"

Actually functionality like this and the according tools have been around for many years, even before PowerToys, macOS/Apple, Windows/Microsoft implemented such functionality. It's not that the PowerToys team invented the wheel for the first time and Microsoft (and all the others) copied it. It's just another take on window management among many others.

Window management is a general/geniune problem with many solutions to it. Sadly, this has not been natively implemented by the operating system manufacturers in a good way (before Windows 11 at least, Windows 7 made a nice start, Windows 10 improved just a little bit) and users have to rely on third party tools.

Just to name a few of those tools:

A quick internet search (like "best window managers") will reveal even more tools.

ghost commented 3 years ago
  1. Inability to choose an zone that is overlapped by others.

Does this setting not allow you to choose?

Yes, this new implementation of overlapping zones' behaviour is great and is the solution to my initial problem. Works great, at least for me. But I also see that there are other suggested solutions to this, like @phazzzy in his comment https://github.com/microsoft/PowerToys/issues/7809#issuecomment-877791382 has mentioned: https://github.com/microsoft/PowerToys/issues/11009

What the Windows 11 way of displaying layouts and arranging windows still does better:

I also like what @phazzzy suggests https://github.com/microsoft/PowerToys/issues/7809#issuecomment-877791382:

It would be nice to be able to see a custom grid in the pop-up window, for example 9×6, and select with the cursor those columns or rows into which the window should stretch.

This is exactly what some of the tools I mentioned https://github.com/microsoft/PowerToys/issues/7809#issuecomment-878194675 do. A grid consisting of 9×6 cells/areas, for example. The user can drag the mouse over the desired cells/areas and the window snaps to this selected area. This is even more flexible than what FancyZones allows and is all possible within one layout -- so no need for a layout switcher any more. Divvy (https://mizage.com/divvy) and Moom (https://manytricks.com/moom) have implemented this grid solution.

Maybe this enhanced way could become a new feature request?

phazzzy commented 3 years ago

@Marrib

The user can drag the mouse over the desired cells/areas and the window snaps to this selected area.

You can now combine a custom layout with a grid and hold down the control key while moving the cursor across multiple cells to specify the desired window size, without having to switch between layouts.

Works great, except it's completely non-intuitive.

ghost commented 3 years ago

Great idea. I have created a 12×4 grid. This layout includes multiple others:

Jay-o-Way commented 3 years ago

So... case closed???

ghost commented 3 years ago

Closed from my point of view (but I can't speak for the other discussants).

phazzzy commented 3 years ago

My problem is also solved, I think you can close the issue.