Reset Mac OS X Windows Position after de-attaching external monitor

72

23

Using Mac OS on multiple monitor is great, but after removing external monitor (2nd monitor) usually windows position originally on the external monitor doesn't get re-positioned to default monitor. Is there any shortcut key or utilities that can reset window position for this kind of usage?

hendrasaputra

Posted 2009-07-15T08:29:08.787

Reputation: 1 164

also see the very popular queestion What Window Management Options exist for OS X?

– cwd – 2014-09-08T23:00:53.193

You can check out http://serverfault.com/questions/7237/retrieving-windows-stuck-on-external-monitor-os-x on Server Fault as well.

– Chealion – 2009-07-15T15:27:45.403

Answers

64

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 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.

SEcondly, 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 ControlPlane 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). ControlPlane is free, but doesn't have any direct mechanism for moving windows (you have to attach it to one of the aforementioned AppleScripts).

Chealion

Posted 2009-07-15T08:29:08.787

Reputation: 22 932

The script from Snipplr worked great. I have not tried the script with X-windows applications yet, which Divvy does not seem to be able to resize. – harijay – 2014-07-25T07:45:16.327

On Mavericks, click that application, on menu bar, Click "Window" > "Bring All To Front" – Ivan Chau – 2014-09-22T07:12:30.020

With multiple displays that Snipplr script might put all the windows on a single screen. Here's a modified version that works with alternate monitor arrangements: https://gist.github.com/vml-rmott/94f2c05e34b82e0c12ed

– rymo – 2014-09-25T18:26:47.363

Using an AppleScript worked for me, I used https://github.com/bradchoate/gather-windows/blob/master/Gather%20Windows.applescript, saved it as .scpt and double clicked on it. Pressed run and fixed.

– Edgar Quintero – 2019-02-16T17:47:24.917

"Gather Windows" only affects—and is only meant to affect—the System Preferences "Display" windows. – Araxia – 2012-04-25T16:55:52.340

@Araxia: Fixed. Odd because I could of sworn I've used it that way before (but it definitely doesn't work that way in Lion) – Chealion – 2012-04-25T18:35:17.527

You can rearrange windows with Divvy too – Irfan – 2012-12-03T09:33:36.220

6

You can also go to Displays and choose turn off/on mirroring and it resets the windows.

Alex

Posted 2009-07-15T08:29:08.787

Reputation: 61

4

breeze has global and application window states. the states can be triggered using they keyboard and are resolution independent. pair this with sizeup and windowflow and you'll be set.

yanokwa

Posted 2009-07-15T08:29:08.787

Reputation: 2 156

3

Try

Window -> cascade

Does this fix your issues ?

m-p

Posted 2009-07-15T08:29:08.787

Reputation: 39

1This option is not available in OSX – Canadian Luke – 2012-09-05T04:19:14.220

4Works for Powerpoint 14.2.1 on MacOS 10.7.4 – m-p – 2012-09-17T20:28:03.547

OK, it doesn't appear in OSX 10.6.8 apparently... Hmmm. Lucky Lion user – Canadian Luke – 2012-09-17T20:55:11.403

3

Hold down the option key and click on the application's icon in the dock twice. The first click will hide the window and the second click will resize the window to fit in the single window.

uhzoomzip

Posted 2009-07-15T08:29:08.787

Reputation: 31

This is the best answer, it works on macOS Sierra too. – Justin – 2017-03-01T20:34:54.320

2

None of these worked, then I read about a trick to delete the plist file. That deleted everything including my registration for the app I was trying to gather the main window, which was open, when I last closed it.

Then I tried the following and succeeded: I changed the key MainWindowFrame to s.th. below my screen resolution, in my case:

<key>MainWindowFrame</key>
    <array>
        <integer>**2237**</integer>
        <integer>474</integer>
        <integer>834</integer>
        <integer>704</integer>
    </array>

to:

<key>MainWindowFrame</key>
    <array>
        <integer>**1000**</integer>
        <integer>474</integer>
        <integer>834</integer>
        <integer>704</integer>
    </array>

That finally did the trick!!!

gr.mon

Posted 2009-07-15T08:29:08.787

Reputation: 21

2which plist file did you edit? – rennat – 2015-08-18T16:12:00.703

1

You can go to System Preferences > Displays and change the resolution to something lower, say 1024 x 768 or 800 x 600 and it will cause windows to reset to that smaller display size. Change it back to what you had an all off screen windows should appear.

Michael Glenn

Posted 2009-07-15T08:29:08.787

Reputation: 156

think this worked – malhal – 2017-02-19T21:06:15.277

1

I once had a weird case where I can only see the application window when switching between spaces. I knew it's somewhere to the left of the screen; I tried many methods described here with no avail.

Eventually, I rearranged my main and external display in display preference so that on is to the upper left of the other, and eventually the window showed up.

TTT

Posted 2009-07-15T08:29:08.787

Reputation: 11

1

I had a similar query for a friend that uses an external monitor with a Macbook, and he suggested SizeUp. I haven't looked into it yet, but it may be what you're after.

jtimberman

Posted 2009-07-15T08:29:08.787

Reputation: 20 109

is it possible that size up is causing the windows to move to the edge of the screen when i wake up my mac? – Andy – 2014-07-02T20:04:23.603

1

When you run multiple displays of different resolutions on Mac, Mac appears to "pretend" that all of the monitors actually have the same vertical resolution by creating "virtual" display realestate to fill in the gaps between each of the smaller displays and the largest display. For example, I have a macbook pro and a 27" Cinema display.

I run my Cinema display at its native resolution, 2560x1440, and the my macbook at the far-right, "more space" setting (it's smaller than 1440, but it doesn't tell me exactly what it is). Because of how I have my monitor and laptop situated on my desk, I use the "arrangement" tab in system preferences to align the bottom edge of the displays. When I do this, there is a section above the macbook screen that is shown as blank or empty in the arrangement window.

HOWEVER, I discovered that if I rearranged things such that the top edges of my displays were aligned, my missing application window was quietly waiting for me at the top-left of the laptop monitor space, thinking it was on-screen and visible the whole time. From there, I discovered that by moving my laptop screen back down to align with the external monitor at the bottom, the system was kind enough to force the now hidden window to the top left of my Cinema display.

user237707

Posted 2009-07-15T08:29:08.787

Reputation: 11

0

I had the same issue when using Pixelmator and having some windows off screen when trying to use it the day after I had been using it at home with my laptop connected to a monitor. Simply go into your displays, set your res to something lower, click the 'gather windows' button and then set your res back to normal and you should see all your Pixelmator (or whatever application) windows.

user26795

Posted 2009-07-15T08:29:08.787

Reputation:

0

I keep the displays preference in the menu bar (there's an option in the displays preference for this). Then whenever the monitor arrangement changes and OS X doesn't detect it you can click here and choose 'Detect Displays'.

Alternatively you could script that action in Automator and assign it a shortcut key yourself. See this link for more information

Mark Pim

Posted 2009-07-15T08:29:08.787

Reputation: 1 574

0

Another thing you can do is go into expose (I think three finger upwards swipe by default), and drag the window onto another screen. If you can get at the bottom righthand corner, it'll pop the window to the top of the screen.

bananabananabanana

Posted 2009-07-15T08:29:08.787

Reputation: 1