Fix a bug where dragging a tab to a window would not work if the
windows would overlap the main window