When restoring the window, auto-refresh the visible windows
Improved the window enumeration to get all visible windows from all processes and threads. This fixes issues where Firefox might have multiple windows open, for example.