Improve multi-window support