I find constraint solvers a perfect fit for window managers. For example, take a look at [1] what scwm [2] could do 21 years ago. Sadly (for me) modern window managers (on Linux or Windows) are way inferior to something we had in the past, usually employing something half-baked that often doesn't work correctly.
[1] https://www.youtube.com/watch?v=SCMUxj2f3Sc
[2] https://en.wikipedia.org/wiki/Scwm