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

137,534

Solution 1

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

Solution 2

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

Solution 3

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.

Solution 4

Try

Window -> cascade

Does this fix your issues ?

Solution 5

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

Share:
137,534

Related videos on Youtube

RedGreenCode
Author by

RedGreenCode

Updated on September 17, 2022

Comments

  • RedGreenCode
    RedGreenCode almost 2 years

    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?

  • Araxia
    Araxia about 12 years
    "Gather Windows" only affects—and is only meant to affect—the System Preferences "Display" windows.
  • Chealion
    Chealion about 12 years
    @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)
  • Canadian Luke
    Canadian Luke almost 12 years
    This option is not available in OSX
  • m-p
    m-p almost 12 years
    Works for Powerpoint 14.2.1 on MacOS 10.7.4
  • Canadian Luke
    Canadian Luke almost 12 years
    OK, it doesn't appear in OSX 10.6.8 apparently... Hmmm. Lucky Lion user
  • Irfan
    Irfan over 11 years
    You can rearrange windows with Divvy too
  • Andy
    Andy almost 10 years
    is it possible that size up is causing the windows to move to the edge of the screen when i wake up my mac?
  • harijay
    harijay almost 10 years
    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.
  • Ivan Chau
    Ivan Chau almost 10 years
    On Mavericks, click that application, on menu bar, Click "Window" > "Bring All To Front"
  • rymo
    rymo almost 10 years
    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: gist.github.com/vml-rmott/94f2c05e34b82e0c12ed
  • rennat
    rennat almost 9 years
    which plist file did you edit?
  • malhal
    malhal over 7 years
    think this worked
  • Justin
    Justin over 7 years
    This is the best answer, it works on macOS Sierra too.
  • Edgar Quintero
    Edgar Quintero over 5 years
    Using an AppleScript worked for me, I used github.com/bradchoate/gather-windows/blob/master/…, saved it as .scpt and double clicked on it. Pressed run and fixed.