When I log in with an external monitor attached, I get very strange behaviour – the external monitor is blank except for the cursor, and the internal monitor displays what should be displayed on the external monitor. When the cursor appears on the external monitor, it interacts with windows that are displayed on the laptop display (and presumably vice versa, but the external monitor is blank, so it's hard to tell).
If I unplug and replug the external monitor, or xrandr HDMI-1-2 --off && autorandr -c
, then everything returns to normal – but this only started happening recently, and it's worked fine for months. What can I do to make my monitors work properly on login again?
I'm using an Optimus laptop (GTX 1050) with the 430.40 proprietary drivers.
Apparently this had something to do with my compositor – I recently tweaked the scripts I use to start and stop the compositor, and apparently broke something. Reverting the changes makes everything work again.