applied Connor's subwindow patch