henkman / virgo

:virgo::computer::computer::computer::computer: Virtual desktops for Windows
MIT License
1.41k stars 258 forks source link

implement window pinning #21

Open Francesco149 opened 5 years ago

Francesco149 commented 5 years ago

this is useful when you're running a multi-monitor setup and want some windows to persist on all desktops (such as having a performance monitor on your 2nd monitor)

the hotkey for pinning is CTRL + SHIFT + ALT + P

I opted for a small fixed size array to save memory since you're not gonna pin many windows anyway

it's kind of a big patch (40+ lines) so I understand if you don't want to merge it to keep the lines of code count low

tecnically using 0 as the empty hwnd value is wrong, but it's highly unlikely that a window that isn't a system window is gonna have HWND = 0, so it should be fine and it saves having to initialize the array to INVALID_WINDOW_HANDLE in virgo_init