Fix top-level window not displaying.

I’ve added a wait_visibility command before every grab_set command as
if the window wasn’t already drawn (a slow computer problem) the window
wouldn’t display correctly.