15

I have a MacBook Pro and connected an external display to it, so far, so great. However, Mavericks seems to insist on opening new applications on the secondary display, even if the currently active (key and main) window/app is on the main display. Incredibly frustrating because they have different screen sizes and it messes terribly with my saved window sizes. Is there any way from stopping Mavericks from doing that? I only want apps to open on the main display, or at least have them remember on which display I closed them last time.

In case it helps, this is my display arrangement from the system preferences: enter image description here

2
  • maybe you should make the other display your primary display. have a look here osxdaily.com/2010/04/27/set-the-primary-display-mac
    – konqui
    Commented Nov 16, 2013 at 7:26
  • Tried it with a clean install, still, same problem. Filed a radar for it, since it does appear to be a bug and nothing on purpose.
    – JustSid
    Commented Nov 22, 2013 at 11:12

6 Answers 6

16
+50

I'm used to connecting to conference room projectors or big-screens that vary in resolution, so as I move from room to room over the course of the day, my windows constantly have to be resized too. So I feel your pain. :-)

In order to avoid confusion, I want to define a couple terms for this answer:

  • The primary display is the one with the menubar in the Arrangement tab in System Preferences.
  • The main display is the one you want stuff on, whether or not it is the primary display.
  • The secondary display is the one without the menubar in the Arrangement tab in System Preferences.

Basically, the problem is that you see an important difference between the main and primary displays; Mac OS X does not, and it's going to fight you when you try to maintain this distinction by treating the secondary display as the main display.

Unless they specifically try to do otherwise, apps will always open on whatever the primary display is. That's definitionally one of the characteristics of the primary display. (It's a pretty low level part of the Quartz API, specifically the CGConfigureDisplayOrigin call, so this behavior is unconfigurable if the app itself doesn't let you configure it.)

I'd suggest maybe asking about the things that are making it annoying for you ("messes with other things" as you put it in your comment) to not keep your main display as the primary display when you connect, because those may be configurable; this behavior is not.

I do have a couple tricks for you that might help, though:

Mirroring and then un-mirroring displays causes all windows too large to fit on the smaller screen to be resized to fit and gets all the windows onto the primary display. It isn't the perfect solution, I know, since you want things on the secondary display, but it can be a useful workaround when combined with the next trick, especially if you know the keyboard shortcut: ⌘-F1. Press it, let the system switch to mirroring, and press it again. All your windows will be resized to the smallest display and will be on the primary display.

Another very useful tool for working around the issue is the BetterTouchTool, which lets you set "Center Window on Next Monitor" and "Maximize Window to Next Monitor" gestures. I assign these to four- and five-finger clicks, respectively, and then I can quickly pop a window from one monitor to the other just by mashing on the trackpad. (If you don't use a trackpad when you're connected to the big display, BTT can do gestures with other pointing devices, too.)

These two tricks together have made working with constantly-changing resolutions not perfect, but at least tolerable. If I want to get all my windows onto the secondary display (I'm giving a training session, say, and want the menubar to be visible to students but I want all my windows not related to the training to be on the other display), I do the mirror/unmirror trick and then four-finger-smack the trackpad a bunch of times until the windows are all popped over.

Finally, if you like to fiddle, you could take a look at this Applescript which moves all windows to primary via a different method. Unlike the mirroring method, which moves windows to primary as a side-effect, this one does it explicitly, so you could modify it to move windows to your preferred main, secondary, display. But it isn't easy, which may give you an idea of why everything's fighting you against this usage. Here's the crucial line of this Applescript:

set position of window x to {0, 22}

Since the menubar is 22 display coordinates (what used to be "pixels" before Retina displays) high, and screens and windows have their origin points at the top-left, this line moves window x right below and flush-left with the menubar. In order to adapt this script so it would instead move all windows to the upper-left of the secondary display, you'd need to figure out its coordinates, and use that as the x value. In the arrangement you show in your screenshot, the "0" there will be replaced by a negative number, since you're to the left of the menubar. It would take some fiddling to get right, especially if you wanted the script to work regardless of the arrangement.

This is all kludgey, I know; but you're going to have to accept kludges if you want your main display and primary displays to be different. That's why I'd really strongly recommend you try to address what's keeping you from letting the other display be primary rather than fighting this particular battle.

4
  • Sorry for the confusion, but I meant that I want my primary display to be the main display (funnily enough, the primary display IS the main display. CoreGraphics returns the same CGDisplayID for them)
    – JustSid
    Commented Nov 23, 2013 at 7:04
  • @JustSid -- Interesting, you're saying that apps are opening on the left-most screen above? That's just plain bizarre and I can't replicate it--as I mentioned, one of the specific behaviors of the main window is that it's where apps open new windows by default. All I can think is, try pushing the display down so that it's not flush on top? I have no explanation for why this would be, but perhaps having your main display be higher on the y-axis would help. I said I couldn't replicate it, but I don't have a smaller external display to try if that--weirdly--is what's causing it.
    – Trey
    Commented Nov 25, 2013 at 0:27
  • Yes, that's exactly the problem. Everything opens on the smaller, secondary screen, even though I want things to open on the big main display! But, re-arranging the secondary display down by a bit did fix the problem! I don't know where you got that idea, but it's brilliant, thank you so much! Going to update my radar and hope that it's fixed in 10.9.1 (it wasn't there throughout 10.7-10.8).
    – JustSid
    Commented Nov 25, 2013 at 9:48
  • @JustSid "you're saying that apps are opening on the left-most screen above?" I have the same issue: apps and documents opening on my secondary display.
    – bames53
    Commented May 4, 2019 at 19:12
5

As of Mavericks, there is a distinction between active and non-active monitors. You can see which monitor is active by looking at your menubar (I presume you use the new Mavericks spaces behaviour). If you compare them on both screens, one will be faded out and one will be mostly opaque. The one which ismostly opaque is activated and new application windows will open on the screenwith the opaque menubar screen unless there are other windows of the same app on the other screen.

So how can you change which screen is active?

Just press anywhere on the desktop on the screen you want the window to open. This will make the menubar of the screen almost opaque and opening the window should now open it on the screen.

Also note that this behaviour is independent from your Docks position. In my experience, I had to click on the desktop (between the fileS) to activate the other screen (by which I mean get it in the active state)

Update

Admittedly that doesn't prevent Mavericks from opening windows on the other screen 8you can go to "mission control" in System settings and uncheck "monitors use different spaces" to get back to the pre Mavericks behaviour. This way it'll open on the screen last closed and/or the screen where the menubar is on. The method I described above the update is just a workaround of the Mavericks way.

1
  • "The one which ismostly opaque is activated and new application windows will open on the screenwith the opaque menubar screen unless there are other windows of the same app on the other screen." I'm opening documents and they're opening on the secondary display despite there being no other windows in that application open on that screen and there being open windows from that app on the primary screen (because I keep moving all of them). If I close a document window on the primary screen and then open that doc again it puts the window on the secondary screen and I have to move it again.
    – bames53
    Commented May 4, 2019 at 19:14
4

with the App open, press F3 to open Mission Control and then drag the app over to the screen on which you want it to open on in the future. It's assigned to a "space" on your computer - Change the space to which it's assigned.

2

New windows will always open in the display with the 'menu bar', so simply move the 'default' menu bar to the Display where you prefer new windows to launch.

Look at the screenshot above of the 'Display Preferences' dialog. Note that only one of the 'Displays' shows a menu bar. Also, note the text "To relocate the menu bar, drag it to a different Display".

1
  • 4
    Well, yes, my point was that the menu bar was already on the right screen and that screen definitely had the focus, yet programs opened on the other screen.
    – JustSid
    Commented Mar 11, 2016 at 18:11
1

I was having the same problem. What I found is applications open on whatever ever screen the dock is on.

I had my screens set up the same as yours, dock on the left side. I switched the dock over to the right and now they open up on the main monitor and not the secondary.

1

To get OS X to always open an App on a specific display in Mavericks or newer, right click on the dock icon for the App and select "Options" - Assign To Desktop 1 Or 2 (Desktop 2 should be your secondary display). I have found this doesn't always work once you drag some Apps to the other display (e.g. Safari in El Capitan). Once there, sometimes it wants to keep opening there and at least in El Capitan, it normally opens on the primary display unless specifically told that way to open on the secondary display. You can also use the OPTIONS -> Assign on the dock to move a program back to any display (can save time by not having to move the mouse to another display to drag it back over, particularly if you have more than two monitors.

I just wish there was an option to have a Dock on every display at all times. I prefer the side-mounted docks and you can't have those migrate which is a royal pain. I've send feedback about this to Apple but they just ignore it. It'd be so easy to have a dock on each screen at all times like the menu bar (maybe even a different dock for each screen for setups where you use certain apps on certain screens often) and have each dock on each screen open apps on that "active" screen. I wouldn't mind having a button on the window itself have a "send to display" either. It's simpler than having to drag windows around, particularly if you have them arranged so they are not side-by-side (e.g. I use diagonal so I don't accidentally move my mouse to the other display and that lets me keep a Dock on my left side of my right monitor as I like the dock on the left and the icons on the right at all times, regardless of monitor positions).

1
  • 1
    The only app I have trouble with is TextEdit which ALWAYS opens files on my TV screen (secondary display). None of the answers in this thread change this behavior. All other apps open in my primary display (Macbook). It's not a tragedy to have to manually grab TextEdit windows from one display, drag them to the other and resize them, but it does fall into the Applesoft category, doesn't it. (Apple preemptively coining that term for its BASIC does not prevent me from also using it to describe Apple products that behave like Microsoft ones.) Commented Jan 28, 2016 at 15:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .