improved floating window handling