8

I have an M1 MacBook Pro. I have two 27" HP E27u G4 monitors each connected directly to it via USB-C cables.

Every time the Mac sleeps (turns off the displays?), when I wake it up it will randomly assign one monitor to the left and one to the right. Meaning, 50% of the time I have to go into System Preferences and manually swap the position of the monitors.

The same thing happens if I disconnect and reconnect them even though I always reconnect them in the same order (first left monitor -> top USB-C port, then right monitor -> bottom usb-c port) on the side of the mac that has 2 USB-C ports.

How can I get the Mac to remember the order of the monitors?

0

1 Answer 1

2

I suffer from a very similar problem. My MacBook Pro (16-inch, 2021), with Apple M1 Max CPU and macOS Monterey 12.6, is similarly unreliable about assigning the left and right external monitors. They are both BenQ EX2780Q models. In my case, the Mac gets it right about 80% of the times it awakes from sleep. When it gets it wrong, I have a couple of workarounds which are usually effective. But it is very annoying.

My two monitors are side-by-side, above the MacBook Pro's built-in display. The left-hand monitor connects via Thunderbolt 3 cable to a Thunderbolt port on the left of the MacBook Pro. The right-hand monitor connects via an HDMI cable to an HDMI port on the right of the MacBook Pro. Normally, the Display Preferences UI labels the left-hand monitor "BenQ EX2780Q (1)", and the right-hand monitor "BenQ EX2780Q (2)".

What I observe is that, when the Mac wakes from sleep, or wakes the monitors from sleep after I have not used them in a while, there is a period of 5-15 seconds when the displays show messages or images, then go black, then display images again. Eventually both monitors show desktop images. I can move my pointer from built-in display to display (1) to display (2). About 80% of the time, the Mac picks the left-hand monitor to be display (1), and the right to be display (2). The rest of the time, it reverses this assignment.

I can tell which outcome I have, even before I enter my password to remove the display lock, by moving my pointer upwards from the built-in MacBook display to display (1). When things are correct, the pointer arrives on the left-hand monitor. When things are wrong, it arrives on the right-hand monitor.

In Display Preferences, macOS always depicts display (1) on the left and display (2) on the right, even when it has got them swapped in real life. I can confirm this by displaying different desktop images on each monitor. The Display Preferences UI shows the desktop images.

My primary workaround is, when the displays awake and before I enter my password to the display lock, to move the pointer up and sideways. This lets me tell if the displays are assigned in reverse. If they are, I press the "Cancel" button (or press the Escape key), and the displays go back to sleep. I wait a second and try again. It seems like the Mac rolls the dice on mis-assigning the displays each time it wakes. But, it has a bias to keep the assignment it currently has, even if it is wrong. Sometimes, the second try is correct. Sometimes I need to try 10 times.

If that fails, my second workaround is to unplug the cable to my right-hand monitor, the one I want to be display (2). Then I wake up the Mac. It has no choice but to make my left-hand monitor be display (1). Then I plug in the cable to my right-hand monitor. It becomes display (2), as I want it to be. The downside of this trick is that, once I unlock my screen, I usually discover that my application windows are on the wrong display.

I tried using displayplacer. It is "a command line utility to configure multi-display resolutions and arrangements." I got it via MacPorts. Displayplacer lets you assign display rotation, resolution, and relative position, using ID numbers which are supposed to be unique and unchanging. For instance, you could command (I shortened id numbers and added line breaks for clarity):

displayplacer "id:1817…1F30+F466…DECD res:1440x900 scaling:on origin:(0,0) degree:0" 
  "id:4C40…22BB res:768x1360 hz:60 color_depth:8 scaling:off origin:(1440,0) degree:90" 
  "id:A46D2F5E-487B-CC69-C588-ECFD519016E5 mode:3 origin:(-1440,0) degree:270"

What disappointed me about displayplacer is that those ID numbers are not attached to the physical monitors. Instead, they appear attached to macOS's idea of "display (1)" and "display (2)". When macOS reverses the assignments, it reverses the relationship of ID number to physical monitor as well. I suppose I could come up with two scripted invocations of displayplacer: one to reverse relative positions of the displays in response to macOS reversing the assignments, and one to correctly position the displays in response to macOS later getting the assignments right. I will leave someone else to write the answer which shows how to do this.

3
  • Is it not also a workaround to exchange the positions of the two external displays in System Preferences?
    – Seg Fault
    Commented Nov 24, 2022 at 8:08
  • Using Display Preferences is a clever idea, but it does not solve the underlying problems. 1. When the problem occurs, Display Preferences shows the external displays incorrectly: right hand display on the left, and vice versa. 2. If I move the displays in Preferences, the names don't change, so now name "Display (2)" will be on the left and name "Display (1)" will be on the right. 3. The windows seem to follow the display names, so windows which should be on the right display will be on the left, and vice versa. Commented Nov 27, 2022 at 11:17
  • Of course, now it clicked, it's because macOS flips both the relative layout of the displays and their content while the change in System Preferences only affects the layout, i.e. at which edge the mouse cursor transitions. How unfortunate. Now I'm not so sure about getting a second display.
    – Seg Fault
    Commented Nov 28, 2022 at 12:24

You must log in to answer this question.