I have a 2012 MacBook Pro (Retina) which I mostly use on my desk. The computer is "docked" via a Thunderbolt display, and additionally a third-party DVI display, which I have hooked up via an Apple Mini Display Port to DVI adapter (the active one, doing 2560x1440). I use the MacBook during the day with the lid closed. So I work on the two external monitors. Via the Apple menu I put the Mac to sleep in the evening. Sometimes, later in the evening, I like to take it downstairs and use it on my lap, so I unplug everything while the Mac is still asleep. I take the computer down and open it up.
Sometimes, when I open the lid up (not always) the internal screen does not come on. The back light illuminates, but there is no display.
I know the MacBook is alive because I can SSH into it. Plugging the external monitors back in, in this state, has no effect. My only workaround at the moment is to wake it up and do my replugging while it's awake but I don't think I should need to do this.
So, what might be causing this how to resolve it?