Skip to content

About

Windhawk mod that keeps the windows in each taskbar group in their on-screen order, left to right.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

24 Commits

Folders and files

Repository files navigation

Taskbar Spatial Order

A Windhawk mod that keeps each app's windows on the Windows 11 taskbar in the order they sit on your screens, left to right, then top to bottom, rather than roughly the order they were opened. Hover over an app's taskbar button and its leftmost window is the leftmost thumbnail; uncombined buttons follow the same order.

Without the mod With the mod
Previews in the order the windows were opened Previews in the order the windows sit on screen

The order follows as windows move, are minimised or restored, open or close. The mod waits until things have been still for a moment, and while a window is dragged or the Start menu, search, notifications or a jump list is open.

Install

From Windhawk's mod catalogue: in Windhawk, choose Explore, search for Taskbar Spatial Order and choose Install.

To try a change from this repository before it reaches the catalogue:

  1. In Windhawk, choose Create a new mod.
  2. Replace the sample code with the contents of taskbar-spatial-order.wh.cpp.
  3. Choose Compile Mod, then Exit editing mode.

On Windhawk 2.0 this is one command: windhawk-cli mod install --file taskbar-spatial-order.wh.cpp.

A copy installed this way is a separate local mod next to the catalogue one, and gets no update offers. Disable the catalogue copy while you try it, and remove the local copy afterwards.

Settings

Setting Default What it does
Minimised windows last On Puts minimised windows after the visible ones. Either way, a minimised window is placed by its restored position: where it sits when not minimised, maximised or snapped.
Skip groups where every window is minimised On Leaves such a group's order alone.
Excluded apps None Executable names, for example mspaint.exe, whose groups are never reordered. Store apps whose windows belong to ApplicationFrameHost.exe can only be excluded together, by that name.

Limitations

  • Windows 11 24H2 and later, with its own taskbar, tested on build 26300; older versions are untested. The mod relies on internal taskbar functions found through Windows debug symbols, which an update can change; if one is missing or looks unexpected, the mod logs it and does nothing.
  • A button that moves is taken off the taskbar and put back, which can show as a brief animation. Only buttons that are out of place move, and they keep their progress bar, overlay badge and thumbnail toolbar buttons.
  • The mod's order wins: a window moved to another place in its group, by hand or by another mod, goes back at the next sort.

How it works

Explorer keeps one item list per app, and every taskbar builds that app's buttons and thumbnails from it, in that order. The mod sorts the item list by the left edge of each window's visible frame, then the top edge, then the window handle, so that two windows in the same spot always come out in the same order. It then takes each button that is out of place off the taskbar and puts it straight back, which makes the taskbar place the button, and its thumbnail, by the sorted list.

Development

docs/design.md explains why the mod is built the way it is, and test/ holds its tests: a harness that checks the mod's logic against a model of the taskbar, and a live test on a real one.

Credits

The move-and-refresh technique and the code that finds the taskbar's lists are adapted from Taskbar Thumbnail Reorder by Michael Maltsev (m417z), including repositioning several thumbnails in one move from his development version. A smaller part comes from his Cycle taskbar buttons with mouse wheel. The header of taskbar-spatial-order.wh.cpp lists what came from where.

Licence

GNU General Public License v3.0, like the mods it builds on.

About

Windhawk mod that keeps the windows in each taskbar group in their on-screen order, left to right.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages