Window snapping in Windows 11

January 21st 2022 Windows

Window snapping was first introduced in Windows 10, but I found the 2x2 grid too limiting, especially since there is no way to resize snapped windows with the keyboard. Keyboard controls for PowerToys FancyZones were also very limited at the time. So I came up with my own solution for keyboard-controlled positioning of windows using AutoHotKey. In Windows 11, the window snapping was greatly improved. That encouraged me to try it again and see if it worked better for me than my own solution.

I like that most of the window snapping features are now accessible from the keyboard. After some experimentation, I found that the following process works best for me:

  • First, I move the window to the correct monitor using Win+Shift+Left Arrow or Win+Shift+Right Arrow.
  • Then I open the snap layouts popup window with Win+Z. In it, I can Tab and Shift+Tab to select a layout and use the arrow keys to select a zone. Finally, I position the window in the selected zone with the Enter key. The snap layouts popup window also appears if you hover the mouse over the maximize window button for a while. Interestingly, this does not seem to work for all windows, as it does with the keyboard shortcut. Perhaps it is because these applications have customized their title bar.

    Snap layout popup in Windows 11

  • After I do this, snap assist pops up for each of the remaining zones in the selected layout, so I can use the arrow keys to select a window to place there and press Enter to confirm the selection. I can cancel the filling of all zones with Esc.

    Snap assist in Windows 11

  • In layouts with only 2 zones horizontally, I can then use Win+Up or Win+Down to place the window only in the top or only in the bottom half of its zone. Then I can use snap assist or Win and the arrow keys to place another window in the newly available part of the screen.

Using this method, I can achieve all the common layouts supported by my custom AutoHotKey shortcuts. The obvious disadvantage is that I usually need more keystrokes to accomplish this. However, there are some advantages as well:

  • The built-in window snapping gives me more flexibility in setting up layouts (without having to remember too many custom keystrokes).
  • Multiple windows are placed in a snap layout for a snap group that appears in the taskbar next to the other windows for each application in the snap group. When you select such a group, all its windows are brought to the foreground. I can also do this with just the keyboard by pressing Win+T to focus the taskbar, the arrow keys to select a snap group, and Enter to bring the windows to the foreground.

    Snap groups in Windows 11 taskbar

  • I can resize the panes of a Snap layout by dragging the dividing line between two adjacent windows. Unfortunately, I have to use the mouse to do this, as I have not found a keyboard shortcut to do it with.

Right now, I alternate between using both methods: my custom keyboard shortcuts and the built-in window snapping. Now that PowerToys FancyZones has better support for keyboard shortcuts, I may try them again before deciding what works best for me.

Get notified when a new blog post is published (usually every Friday):

If you're looking for online one-on-one mentorship on a related topic, you can find me on Codementor.
If you need a team of experienced software engineers to help you with a project, contact us at Razum.
Copyright
Creative Commons License