Apple - How to retrieve windows that have moved 'off-screen'

Chealion answered this on SuperUser.

I won't copy and paste his answer here, as he got the credit not me.

But basically, what you could do is (quoted from Chealion's answer) :

A second method of arranging the Windows so you can see them (if for some reason they're staying off screen) is to change to the application that owns the window in question, hold the Option key down and choose "Arrange in Front" from the Window menu. It will then arrange all the windows of that application in a cascade from the top left of the screen.


For completeness:

From my answer originally at Server Fault Question 7237:

When a monitor is unplugged (including the adapter as well if applicable - leaving the adapter leaves OS X thinking the monitor is still plugged in) all the Windows should move onto your main screen. Occasionally some windows (eg. Firefox) will keep their position on the very far right of the screen leaving you just enough room to grab the title bar and move it where you'd like to.

One method is before you unplug the external monitor (or before you unplug the dongle) is to open up the Displays Preference Pane in System Preferences and click on the "Gather Windows" button. This is supposed to bring every window on the main screen and the option does not appear if you don't have a second monitor plugged in.

A second method of arranging the Windows so you can see them (if for some reason they're staying off screen) is to change to the application that owns the window in question, hold the Option key down and choose "Arrange in Front" from the Window menu. It will then arrange all the windows of that application in a cascade from the top left of the screen.

Lastly, there are several AppleScripts available (eg. this one at Snipplr) that will also grab every window off screen and move it on screen for you.

There is also a nifty shareware app called Stay that will help automate a lot of this for you, while there is also MarcoPolo which will do much more than just notice if a monitor is disconnected and allows you to run scripts (in case you want to do more than just rearrange the windows).


I thought I should make an answer to this that describes solutions specifically for XQuartz. Many of the solutions here do not work for XQuartz. From this ticket: https://xquartz.macosforge.org/trac/ticket/796 , I've found two solutions that work and I feel it would be beneficial to state them here.

  1. If you can unplug/plug-in your monitor easily, then unplug your monitor so that your window appears in a spot that you can access. Then, with your mouse, click on the window and hold down the mouse button as if you are going to drag it. Without letting go of your mouse or the window, plug in your monitor. The XQuartz window should stay where your mouse is.

  2. This ShiftIt package works very well for getting windows that have disappeared off-screen: https://github.com/fikovnik/ShiftIt/downloads There may be other similar packages, but this one is clean and effective.

Hope this helps someone!