Secondary Monitor Pin
Keeps windows that are placed on secondary monitors pinned so they appear on all virtual desktops.
Author: tafadias
Automatically pins windows that are placed on a secondary monitor so that
they are shown on all virtual desktops, the same as choosing Show this
window on all desktops from the window's title bar context menu.
When a window moves back to the primary monitor it is unpinned again, but only
if this mod was the one that pinned it. Windows that were pinned manually are
left untouched.
The mod runs as a tool mod in a dedicated process, so it does not inject into
explorer.exe. It only talks to the virtual desktop manager when a window
changes monitors, when a new window appears or when a window closes, which keeps
the number of shell calls low and keeps switching virtual desktops smooth. A
timer polls for monitor changes that the window event hooks do not report, such
as Win+Shift+arrow, programmatic moves and display changes.
Windows that are on another virtual desktop are pinned too, so the
secondary-monitor windows of every desktop end up shown together on all
desktops.
Notes
- Uses undocumented Windows virtual desktop interfaces, which may change with
future Windows updates.
- Works on Windows 10 and Windows 11.
- Do not run this mod together with another tool that also pins windows across
virtual desktops, as two implementations competing over the same shell
interfaces can cause issues.