Move an off-screen window back on-screen on Mac OS X

305

52

It seems that Mac OS X 10.6.1 Snow Leopard has a tendency to leave some windows off-screen at times, especially when I disconnect an external monitor from my MacBook. How can I move the window back on-screen when it's not possible to grab the title bar and drag it back onto the screen?

XvsXP.com recommends adjusting your screen resolution downward to have off-screen windows "snap back into view" and then adjust your screen resolution back to its original setting. In OS X 10.4 Tiger, I had a script that brought all off-screen windows back on-screen, but in my upgrades to Leopard and now Snow Leopard, I don't seem to have that script.

Any better solutions out there?

Matthew Rankin

Posted 2009-10-14T15:53:37.737

Reputation: 4 340

I was able to recover an x11 window by moving the spawning display over to the other side of an adjacent display. In other words, I had the following arrangement with my monitors [ 2 ][1], and the x11 window was spawning off-screen to the apparent left of [1]. By rearranging: [1][ 2 ], my x11 window correctly appeared on window [1]. I'm on OS X 10.10. – HAL 9001 – 2015-01-10T20:57:49.370

I've found that deleting the offending reference items from Interface Builder's plist sometimes helps. I've even tried to set the window's position via AppleScript with no luck. – None – 2010-08-16T05:28:15.277

You may want to check out a very similar question: Reset Mac OS X Windows Position after de-attaching external monitor

– Chealion – 2009-10-14T17:19:38.890

Answers

316

This method seems to work: click on the Window menu, then click Zoom

Hai Vu

Posted 2009-10-14T15:53:37.737

Reputation: 4 824

19Great solution, except Photoshop has it's own non-standard implementation of the Window menu, and has no zoom option. Bloody Adobe. – Rory McCrossan – 2014-07-09T06:22:32.063

Worked for iTunes. Never seen that option before; I always assumed it'd be called "maximise". Jazzy! – Matt Fletcher – 2014-09-25T10:40:20.010

"Untitled" (X) checked (focused) in TextEdit doesn't reappear when pressing zoom .. Hmm .. This is one of the most annoying things about OS X. – dezza – 2015-03-23T13:32:53.163

Like a similar comment above, FileZilla does not have a Window menu option...so didn't work for me. – DemiSheep – 2015-10-22T16:37:11.170

Doesn't work on modal windows either, e.g. TextWrangler's "Find" window... there is no "Zoom" option :( – Doktor J – 2015-12-03T07:50:07.260

Using Filezilla, enter fullscreen mode and exit, next time you'll open it, it'll be on screen. – P. Lalonde – 2016-01-04T19:45:15.407

This does not work with VLC. Fortunately clicking from menu "Quit and Keep Windows" (how ironic) has helped. This option appears after holding 'alt'. – niieani – 2016-01-20T18:30:40.397

Zoom makes the window visible, but if I unzoom it becomes invisible again. I.e. it remembers the unzoomed position. This for Microsoft's PowerPoint app, although I believe I have had similar problem with apps from Apple. – Krazy Glew – 2016-04-14T18:11:11.413

When the other answers do not work (Zoom, change resolution, etc.): Cascade Windows --- in detail: select the app in the Dock; the Windows menu for the app, WAAAY at the top of my large screen, has items like Zoom, Cascade, Arrange All, Bring All to Front. Although Zoom has the problem I mentioned in a previous comment, Cascade and Arrange All work, and are persistent. (This with PowerPoint.app; may be restricted to apps that have multiple windows.) (I dislike the app menu at the top of my large screen, but it worked here; I wish MacOS had a window manager.) – Krazy Glew – 2016-04-14T18:19:28.567

Wow thanks for this answer! This window issue had me pretty annoyed and this was an easy fix. – CodeGuyRoss – 2016-09-27T12:32:55.293

I usually have iTerm2 set to full-width top, and it has gotten off-center, either from some display switching/re-arranging, or some sort of accidental rogue click I just did. Sometimes I was able to full-screen it using the green icon in the upper left corner, but this didn't work when I dragged it out from a full screen space. Usually it auto-centers after that operation. This zoom approach did work however. – Pysis – 2017-06-07T14:48:44.287

After zooming the window, it can be resized in-place without 'unzooming' it first, since unzooming puts the window back where it was before. – ash – 2018-03-30T16:52:55.920

The next answer should work for all applications. – James Robinson – 2013-09-08T20:35:05.407

6Zoom didn't work for me. Now the window is just bigger, but still not where I can reach it. – bugloaf – 2014-03-18T03:35:39.153

8For the first time in months, I just ran into this problem with Parallels. Unfortunately, they don't have a zoom menu option under the Window menu. – Matthew Rankin – 2010-01-15T15:25:10.937

123

Haven't read through the whole thread but the easiest way I found was to change the resolution of the screen:

Go to System preferences » Displays and then change the resolution.

This will force your computer to render the display again and reposition all open windows. Then just switch it back to your original resolution settings and everything should be back in place.

Philip Ebanks

Posted 2009-10-14T15:53:37.737

Reputation: 1 231

Make the window as small as possible, then change the resolution. Worked for me with Filezilla. – Gavin Thornton – 2014-08-08T04:59:25.980

had my photoshop window out of screen. changed resolution to the maximum, resized the window to get smaller, changed resolution back. working – Rayjax – 2015-04-18T11:40:19.390

This doesn't work for modal windows either, such as TextWrangler's "Find" window :( – Doktor J – 2015-12-03T07:50:39.197

4In my case, the app (xScope) didn't have a Zoom option, and my new Mountain Lion build wasn't showing a "detect displays" function, so this tip worked perfectly. Thanks! – Jon – 2012-08-05T16:07:11.017

+1 worked for me too. (On Lion trying to get the iPhone Simulator window). Zoom was disabled for this app. What makes this easier is having the Displays button in the menu bar (System Preferences->Displays->Show displays in menu bar) - this way you can quickly change resolution or detect displays – Rhubarb – 2012-10-12T16:54:05.460

Also worked with Virtual Box, which was full screen in another (non-existent) display. I didn't have a menu bar at all. Thanks. – mwilson – 2013-10-04T13:44:23.247

Didn't work for me. I resized the display, but the window is still sitting out of reach. I can see it in Mission Control, but I can't touch it, so maddening! – bugloaf – 2014-03-18T03:37:05.503

3Rotating 90 degrees and reverting worked for me. – mjhm – 2014-04-16T22:34:58.360

46

Three ideas:

  • CmdF1 (or CmdfnF1 if you've configured your MacBook's keyboard to use normal function keys) toggles your displays between mirror mode and extended desktop. A side effect is that windows get moved around somewhat unpredictably. This might move the missing window to somewhere visible. This likely requires the external monitor to be connected though.

  • Turn on Spaces, hit the hot key to displays the spaces overview and see if your missing window outline is visible there. If so, drag it to where you want it to be.

  • Quit the application and relaunch. Definitely a non-ideal solution and not practical if there's unsaved work.

Doug Harris

Posted 2009-10-14T15:53:37.737

Reputation: 23 578

Your first option worked for me. I have a macbook Pro with two monitors attached. I don't use the macbook as a screen. Cmd F1 worked like a charm. Thank you – ntgCleaner – 2014-11-17T16:21:45.050

4Cmd-F1 to toggle into Screen Mirror worked like a charm. And then Cmd-F1 back to my normal mode. – Bryan Focht – 2015-08-25T17:30:00.650

Cmd+fn+F1 worked perfectly! Thanks a million! – theMarceloR – 2017-12-27T09:39:34.283

Toggling between mirror mode and extended desktop didn't work. I decided to quit Parallels, which brought up a dialog box prior to quitting. With the dialog box up, I moved the Parallels window back on screen and then selected "Cancel" from the "Are you sure you want to quit?" dialog box. Still wish there were a better way. – Matthew Rankin – 2010-01-15T15:30:43.720

37

Some windows can be moved by for example dragging them horizontally from the bottom edge.

You could also try running scripts like this in AppleScript Editor:

tell application "iTunes"
    set bounds of windows to {100, 100, 800, 800}
end tell
tell application "System Events" to tell window 1 of process "UltraEdit"
    set position to {100, 100}
    set size to {800, 800}
end tell

Lri

Posted 2009-10-14T15:53:37.737

Reputation: 34 501

This worked for X-Lite when everything else failed. There was no "Zoom" in X-Lite and changing the display scale didn't work since X-LIte was on another display entirely. – David W. – 2014-06-27T14:20:46.020

Thanks! The second script (but not the first) worked for me for FileZilla. Make sure the you're on the same desktop as the app in question when running the script. – Tom – 2014-10-15T13:29:27.333

Excellent, works on VLC too, which has a habit of getting stuck off-screen when it was previously being used on a now-disconnected external monitor. – Benji XVI – 2014-12-30T11:26:37.070

Whew! Worked for me for FileZilla (The second one with the phrasing `window 1 of process "FileZilla". None of the others did though. Thanks! – Taytay – 2015-02-02T14:12:21.460

This one does the trick for Adobe Illustrator. If anyone is wondering how to target an application, it's the full name in the dock. I had to use "Adobe Illustrator CC 2014" in place of UltraEdit and it worked like a charm. – Barrett Kuethen – 2015-08-13T23:46:42.427

Drag bottom edge! How easy! Doh! – GreenAsJade – 2015-11-27T00:06:49.173

I've made this into a command-line script with specifiable application name, and without modifying the widths and heights of windows at https://gist.github.com/jnothman/f794197abeb2da4ff6470ac791d014eb

– joeln – 2017-04-19T07:42:46.473

this does not work with e.g. UltaEdit - there is an error message that the bounds can not be set. Also the syntax seems to be "set the bounds of the first window to ..." – Wolfgang Fahl – 2013-10-31T06:54:37.720

1@WolfgangFahl set bounds of windows to is also correct syntax, but I edited the answer to add a second script that worked for me with UltraEdit. – Lri – 2013-10-31T11:38:58.493

36

If you can see a portion of the window, hold down the Option key and then click on one of the borders of the window. This will allow you to drag the window into full view.

Jim Geurts

Posted 2009-10-14T15:53:37.737

Reputation: 535

1I voted another answer up a long time ago, but now on a different OS, This worked for me. It's like holding alt and dragging a new shape in adobe programs! – ntgCleaner – 2015-06-04T00:59:16.700

This has worked flawlessly for me with a number of X11 applications that insist on opening up outside of the viewable space of my desktop. I typically see just a little bit of these windows and the above tip has worked to allow me to drag them back into view. – slm – 2015-06-22T20:13:02.097

I had to hold Shift-Option for this to work ... but ... fanstastic, thanks! – GreenAsJade – 2015-10-16T00:28:53.597

Neither Option or Shift-Option is working for me in Yosemite with FileZilla :| – DemiSheep – 2015-10-22T16:40:29.663

Thanks! This also allows me to resize photoshop when it's off screen. Seems like the only answer that work on all app windows! – dval – 2016-02-29T11:21:36.497

This worked great for me, but I don't think it will work 100% of the time. It works by moving the opposite side of the window an equal distance inward as you drag the other side. Therefore, I think there are situations where the distance you can drag inward isn't enough to bring the opposite side in enough. Still, worked for me this time, so thanks! – mattsoave – 2016-10-28T20:49:27.223

This works, but it sometimes requires several cycles of option-key dragging and regular resizing to get the window down to the right size if, say, you were using it on a much larger monitor previously. – elixenide – 2018-06-04T04:45:00.450

21

None of the above worked for me, but I managed a fix by changing:

  • System Preferences
  • Hardware
  • Displays

Then go to the 'Arrangement' 'tab' and drag the external window on top of the internal one (instead of side-by-side).

Michael Durrant

Posted 2009-10-14T15:53:37.737

Reputation: 211

This worked for me, unlike all the other suggestions. However, it's not an ideal solution.... I'd like to be able to keep my current arrangement if possible. – nukeguy – 2015-04-05T23:48:23.030

1Nothing else worked for me - it is fascinating why this will bring back an inkscape window on MacOS while no keyboard option no nothing will help. – Wolfgang Fahl – 2017-06-25T05:05:13.953

9

If Window/Zoom option from menu won't help (as suggested in 1st answer):

Window/Zoom on OSX

(this could happen when application has it's own non-standard implementation of the Window menu like Adobe Photoshop),

you've to go to Displays Settings and select 'More Space' (Scaled) option.

See:

Displays - Scaled - More Space

If you'd like to have some permanent solution, please install BetterTouchTool, which provides extra options (gestures) for moving the windows. In example:

BetterTouchTool - Move windows

kenorb

Posted 2009-10-14T15:53:37.737

Reputation: 16 795

1My resolution on my monitors were already maxed out , but setting from 'Best' to 'More Space' and then setting it back to default made the Filezilla window end up as full screen on my Macbook Pro screen – DemiSheep – 2015-10-22T17:00:48.753

1The scaling + option-drag-window-edge worked for me. – Jorge Orpinel – 2015-11-25T21:53:03.243

8

I had this problem with Parallels desktop 6 in OS X Lion, whereby the VM's actual window was hidden off-screen, and only visible in Mission control, and when you swiped between spaces.

So for those with the same problem, and hopefully this is applicable elsewhere: The solution is to right click on the Application's icon in the Dock, then go to the 'Options' menu item, and under 'Assign To' choose 'This Desktop'. That should move the app window back on to the current desktop. Still preferred the old spaces pref pane for this sort of thing - much faster.

Hope that helps those stumbling upon this post, with the same problem with Parallels (as I did)

Note that on Lion, there is no Assign To option in this position.

purpletonic

Posted 2009-10-14T15:53:37.737

Reputation: 572

This answer worked for me, and is the only one that doesn't seem like an enormous hack. – durron597 – 2016-04-11T17:54:54.500

8

I have found a way, by using "Force Quit ...", by clicking the  icon in left top corner.

Use it to force-quit the app, then start it again. It starts fresh, and the window is on-screen.

wgui

Posted 2009-10-14T15:53:37.737

Reputation: 81

This Moom suggestion saved me. – AndyBean – 2014-11-18T02:26:15.767

Didn't work for me with Filezilla - I even installed a updated version and it didn't reset the window (didn't uninstall old version) – DemiSheep – 2015-10-22T16:47:30.583

I can confirm this worked for Inkscape on El Capitan – Wray Bowling – 2016-09-19T15:05:38.627

underrated solution IMO – w3debugger – 2019-03-11T06:49:56.730

7

If you still have an external display hooked up, or are reconnecting the external display, and at that point have the window offscreen and unmanagable, it is possible to right-click the icon for that application in the dock and force the window to snap to the other display.

This will allow you to adjust the window position without the need to modify the resolution of displays or open the system preferences tab. Still not as easy as an MS Windows solution, but definitely easier than going through all of the rest of that hassle.

James Brewer

Posted 2009-10-14T15:53:37.737

Reputation: 394

no option for that on yosemite – Chuck van der Linden – 2016-08-31T03:43:52.837

This worked for me with Sequel Pro app on High Sierra. It was off screen and I couldn't see it's menu bar. Selected Display 1 and it worked. Thanks! – Najki – 2018-10-03T07:55:34.927

5

None of the above methods worked for me on OSX 10.7.4. I was trying to access KeePassX, which was completely off the screen. (I had moved it to a second display at home, but was now at the office, with no second display.)

Changing resolution back and forth had no effect. Closing the app and opening it up again, had no effect.

However, when I closed the database, and asked to open a new one, it moved the window so I could access the dropdown to select a file. (yay!)

NotoriousWebmaster

Posted 2009-10-14T15:53:37.737

Reputation: 151

4

Hold option + click the app icon in the dock two times and it will first minimize, then restore the windows into full view on your desktop.

Justin

Posted 2009-10-14T15:53:37.737

Reputation: 205

This doesn’t appear to work in macOS 10.14 Mojave. – jasonology – 2019-09-09T23:26:22.473

It is still working for me in Mojave v10.14.6. – Justin – 2019-09-16T17:08:59.513

3

The position of the views are saved in the nib files themselves. The way I fixed this was to make a change to the View and then saved it. Shut down Interface Builder and started it again. My window and view where gathered back to the main screen. I have to say that I tried all the options before doing this. That is the Zoom, deleting the .plist from Library/Preferences, F8, Gather Windows... None of those worked. I hope this helps.

Nima

Posted 2009-10-14T15:53:37.737

Reputation: 1

3

I tried pretty much everything above for a token app called SecurID we use for VPN access for work. This AppleScript finally solved it (courtesy of http://www.leonamarant.com/2008/04/02/how-to-get-off-screen-windows-back-on-your-mac-os-x-v105/)

-- Example list of processes to ignore: {"xGestures"} or {"xGestures", "OtherApp", ...}
property processesToIgnore : {}

-- Get the size of the Display(s), only useful if there is one display
-- otherwise it will grab the total size of both displays
tell application "Finder"
    set _b to bounds of window of desktop
    set screen_width to item 3 of _b
    set screen_height to item 4 of _b
end tell

tell application "System Events"
    set allProcesses to application processes
    set _results to ""
    repeat with i from 1 to count allProcesses
        set doIt to 1
        repeat with z from 1 to count processesToIgnore
            if process i = process (item z of processesToIgnore) then
            set doIt to 0
            end if
        end repeat

        if doIt = 1 then
            tell process i
                repeat with x from 1 to (count windows)
                    set winPos to position of window x
                    set _x to item 1 of winPos
                    set _y to item 2 of winPos

                    if (_x < 0 or _y < 0 or _x > screen_width or _y > screen_height) then
                        set position of window x to {0, 22}
                    end if
                end repeat
            end tell
        end if
    end repeat
end tell

DustinB

Posted 2009-10-14T15:53:37.737

Reputation: 151

I had the same problem with the stupid little secureID app. This post saved me, thanks! – Jake Hall – 2016-01-21T15:20:17.153

2

Go to System Preferences » Displays » Detect Displays.

It will force the system to rescan, and detect the missing monitor... That typically solves the problem when I run into it.

Also, if that doesn't work, and your system still believes that the monitor is connected try two things:

  1. If you have the cable still connected (but unconnected to a monitor), disconnect it.
  2. On the arrangement tab on the displays panel, try "Gather Windows". That should gather all the windows to the active / primary monitor.

Benjamin Schollnick

Posted 2009-10-14T15:53:37.737

Reputation: 4 313

This may or may not work. I found Wireshark (an X Windows app), would be off the display when a 2nd display was connected. This was actually an XQuartz bug (acknowledged). It's unclear if this is an Apple bug, or an XQuartz bug. See http://xquartz.macosforge.org/trac/ticket/797.

– Benjamin Schollnick – 2014-10-04T21:47:38.753

I tried using Detect Displays and that didn't work. I didn't try the "Gather Windows" option, but I will next time. – Matthew Rankin – 2010-01-15T15:28:51.727

2

The simple answer for me, if you're just completely removing external monitors (e.g., for going to a conference with your laptop) is to just close the lid and open it again. All of the other answers (^1, Zoom, moving windows) did not work for me.

user1442960

Posted 2009-10-14T15:53:37.737

Reputation: 131

1

The WindowZoom method is interesting and likely what I'd use if not for Moom. It lets you set up hotkeys for repositioning and resizing windows. I have a 9 cell grid (altoption1-9) as well as left/right halves and a few others.

The Moom default for centerring and expanding a window is controlshiftz then space - I changed this to altz. Super useful for screencasts too as you have much greater control over window positioning.

Koobz

Posted 2009-10-14T15:53:37.737

Reputation: 258

0

I wonder why it was not mentioned before but there is a very simple way to solve it.

You can grab one of the horizontal or vertical edge of the window (not the corners, though) and move the mouse parallel to the edge, not in the direction you normally would in order to resize the window.

That is, if you move the horizontal edge of the window horizontally or the vertical edge vertically then it does not resize the window but moves the whole. Now you can drag the missing part of the window back to the screen.

Csongor Halmai

Posted 2009-10-14T15:53:37.737

Reputation: 161

0

A third party solution is to use HyperDock. It is currently compatible with macOS 10.14 Mojave.

This utility modifies the Dock to show a preview of each application’s windows floating above the application icon.

These are draggable, so you just pick the window you wish to view and drag it to the monitor you need it to be on.

jasonology

Posted 2009-10-14T15:53:37.737

Reputation: 138

0

For extreme cases, like I'm encountering with Interface Builder, you can try re-connecting your second monitor, finding that missing window and then dragging it back to the primary display.

Now, to check your work, quit the program and then re-launch it ensure that all of the desired windows are living on your primary display.

Now, disconnect the second monitor - things should be ok.

JJ Rohrer

Posted 2009-10-14T15:53:37.737

Reputation: 151

0

In my situation, the window disappeared on Mavericks after I unplugged one of my external monitors. I still had another external monitor plugged into my MacBook Pro, while the windows moved from the unplugged external were shifted to my built-in display. One window for Chrome was well outside the actual display, but with the way screens and "Spaces" work in Mavericks no part of it showed on the other displays.

The easiest way I have found is to open Exposé (either by pressing F9 if you have re-enabled that keyboard shortcut, or by swiping up with three or four fingers depending on your configuration) and drag the missing window from one monitor to another. This will cause OS X to position the window within the bounds of the new monitor automatically, and it will be visible again.

Bryson

Posted 2009-10-14T15:53:37.737

Reputation: 431