PowerToys icon indicating copy to clipboard operation
PowerToys copied to clipboard

Keyboard shortcut that switches focus to the topmost window in the next zone

Open paraschivescu opened this issue 2 years ago • 1 comments

Description of the new feature / enhancement

FancyZones doesn't allow you to focus a zone, only windows assigned to that zone, but this feature is the next best thing.

Pressing this keyboard shortcut should cycle between the top window in every zone. (Suggested shortcut: Win + Shift + Tab) So, similar to Alt-Tab, but instead of cycling through all open programs, you would only cycle through the programs that are currently on top in each zone.

Scenario when this would be used?

Example use case:

  • You have a three-zone setup with multiple windows in each zone.
  • You want to switch to the topmost window in the third zone, using the keyboard.
  • Currently, this is only possible using Alt-Tab. (which you might have to press numerous times, and pay attention to which window is currently highlighted)

Supporting information

Note: I know that there is an existing feature which allows cycling between programs assigned to the same zone as the active window (Win + PgUp/PgDn). This is not the same thing! I will be happy to clarify with more examples, if needed.

paraschivescu avatar Apr 12 '22 15:04 paraschivescu

This would be super helpful for working primarly with the keyboard. There is also already an older issue #15067 which seems to be about the same feature

shardrunner avatar Nov 04 '22 08:11 shardrunner

I'm also interested in this enhancement, and thinking about trying to implement it. I think a reasonable design would be to use the same options and zone traversal order as the windows snap override.

Example: You have a 2x2 grid of zones each containing multiple windows, and you have this focus feature set to navigate by relative location. You have bound this focus navigation to win + alt + up/down/left/right. The top-left window has focus. Pressing win + alt + right would move focus to the top right window. The pressing win + alt + down would move focus to the bottom right window.

Example: You have a 2-column zone layout with each zone containing multiple windows. You also have a newly opened floating window not assigned to any zone. If you press win + right the new window would be moved to the rightmost zone, but if you press win + alt + right, your focus would switch to the topmost window of the right column.

Example: You have multiple monitors with any zone setup. You have configured this focus navigation (and the windows snap override) to cycle through zones by index. Pressing win + alt + right repeatedly moves focus between the topmost windows in each zone in a fixed order.

I've had a look at the code and it looks like the layout management keeps track of the most recent assignments to zones, I would only use those lists to look for the next focus target for this feature. I haven't yet seen if there are any updates to these assignments if the windows are manually moved/resized out of the zones, or if we would need to check for that when searching for the next focus target.

crnobog avatar Jan 19 '23 04:01 crnobog

You would make my day (heck, my week) if you were able to implement this 😄 It's the main thing I'm missing from dwm on Linux and despite this not getting many upvotes, I'd be surprised if a lot of people didn't find this super useful once they actually used the feature.

paraschivescu avatar Jan 19 '23 09:01 paraschivescu

Like @paraschivescu I'm missing this from the pop-os shell, it will be really usefull if implemented

Gu7z avatar Mar 13 '23 18:03 Gu7z

I would also be really interested in an implementation of this, would be a wonderful feature for me as alt+tab never really did this for me because if you have a lot of active windows it is really inconvienient.

8BitKing avatar Aug 25 '23 18:08 8BitKing

Genuinely question: which is the better avenue to push for this feature? here? or msft feedback hub \ snap groups?

JEFF-LIU-me avatar Mar 28 '24 04:03 JEFF-LIU-me