'xdotool search --sync' sometimes fails when searching for window. Fix that by ensuring the windows is already visible when trying to enter keys there.