Mavericks 'close the clam' woes I typically use my "Retina, 15-inch, Late 2013" MBP at work with the lid closed, connected to an external monitor, a bluetooth trackpad, and a USB keyboard. For the last few months, the results of disconnecting these items and opening the lid have been very frustrating: a black screen that cannot be woken. I end up power-cycling.

I started to compensate by opening the lid before disconnection. For a while, that worked. Most recently, the result of this is that the monitor is alive, but the builtin keyboard and trackpad are ignored. The bluetooth trackpad (if in range) works just fine. This latest behavior seems to me to cast some doubt in the theory that this is a duplicate of MBP Mid 2009 thinks the lid is closed permanently, but only some doubt. Log starts like this, I will shortly post more of it elsewhere.

See a gist containing a whole lot of log, exerpt:

Aug 29 06:34:56 tinfoilhat-2 kernel[0]: full wake (reason 1) 8841 ms
Aug 29 06:34:56 tinfoilhat-2 kernel[0]: vm_compressor_fastwake_warmup (448 - 9340) - starting
Aug 29 06:34:56 tinfoilhat-2 kernel[0]: AppleCamIn::systemWakeCall - messageType = 0xE0000320
Aug 29 06:34:56 tinfoilhat-2 kernel[0]: AppleCamIn::systemWakeCall - messageType = 0xE0000340
Aug 29 06:34:56 tinfoilhat-2 kernel[0]: SMC::smcHandleInterruptEvent WARNING status=0x0 (0x20 not set) notif=0x0
Aug 29 06:34:57 tinfoilhat-2 kernel[0]: AppleCamIn::systemWakeCall - messageType = 0xE0000340
Aug 29 06:34:57 tinfoilhat-2 kernel[0]: AppleCamIn::systemWakeCall - messageType = 0xE0000300
Aug 29 06:34:57 tinfoilhat-2.local WindowServer[103]: CGXDisplayDidWakeNotification [16519052069849]: posting kCGSDisplayDidWake
Aug 29 06:34:57 tinfoilhat-2.local WindowServer[103]: handle_will_sleep_auth_and_shield_windows: Deferring.
Aug 29 06:34:57 tinfoilhat-2 kernel[0]: [BNBTrackpadDevice::init][80.14] init is complete
Aug 29 06:34:57 tinfoilhat-2 kernel[0]: [BNBTrackpadDevice::handleStart][80.14] returning 1
Aug 29 06:34:57 tinfoilhat-2 kernel[0]: [AppleMultitouchHIDEventDriver::start] entered
Aug 29 06:34:57 tinfoilhat-2.local WindowServer[103]: Received display connect changed for display 0x3f003e
Aug 29 06:34:57 tinfoilhat-2.local WindowServer[103]: Found 1 modes for display 0x003f003e [1, 0]
Aug 29 06:34:57 tinfoilhat-2.local WindowServer[103]: Received display connect changed for display 0x2b10130f
Aug 29 06:34:57 tinfoilhat-2.local WindowServer[103]: Found 1 modes for display 0x2b10130f [1, 0]
Aug 29 06:34:57 tinfoilhat-2.local WindowServer[103]: Display 0x2b10130f changed state to offline
Aug 29 06:34:57 tinfoilhat-2.local WindowServer[103]: No display devices are on-line. Switching to virtual display mode
This is almost certainly hardware related. The magnetic reed switch (or hall effect sensor) depending on vintage of the Mac is faulty or failing and potentially voltage fluctuations due to sleeping are affecting it as well.

Any chance you have had it looked at by a tech?