glzr-io / glazewm

GlazeWM is a tiling window manager for Windows inspired by i3wm.
GNU General Public License v3.0
5.81k stars 167 forks source link

Feature Request: Set up workspaces per windows Virtual Desktop #82

Open KiLLeRRaT opened 2 years ago

KiLLeRRaT commented 2 years ago

I am wondering how hard it would be to implement a full set up GlazeWM workspaces PER Windows Virtual Desktop. so desktop 1 would have spaces 1-9 for me. Then Desktop 2 would have a different set of spaces 1-9, etc... That would be amazing :)

My use case is I have my personal stuff on desktop 1, and then I have separate desktops for each of my client projects I have open. Each client may have many windows and tools open at the same time, because I jump to different customers quite frequently during the day. Just having a single set of 9 workspaces isn't quite working for me, I don't have enough maneuvering to have many windows open, and many different clients things open.

Let me know how doable that is going to be, and if you have and pointers of where I should start looking in the code.

Cheers,

lars-berger commented 2 years ago

Unfortunately I haven't looked too much into the APIs for working with virtual desktops and there's currently some weird behavior when using them. The topic's come up in a discussion before here.

Your use case is definitely valid though and I agree that having a separate set of workspaces on each virtual desktop would be the ideal. However, it's a pretty tough problem to solve. For example, the WM listens for window events like close, minimize, focus, etc., and these aren't isolated to a particular virtual desktop. There'd have to be some way to know which virtual desktop a window belongs to and handle its events accordingly.

If you truly want to approach this problem, one approach would be to change how the ContainerTree (see ContainerService) is structured. Currently, there's a root container with monitors as children, then workspaces, then split containers & windows. To account for virtual desktops, you'd have to a create new container type under the root container for representing a desktop (meaning each desktop has a different set of monitors, workspaces, windows, etc.). Somehow on creation/deletion of a virtual desktop, it'd create/delete the corresponding desktop container (there's an undocumented way to hook into this described here).

Also, do note that you can have more than 9 workspaces - just define more in the user config and assign a keyboard shortcut to switch to that workspace. It does admittedly get pretty awkward defining keyboard shortcuts with that many workspaces though.