So I'm running FreeBSD 13.1-RELEASE-p3 on a laptop, and have observed that if I hot-unplug an external monitor that was working before, the built-in screen just goes totally black. There's a hint of a cursor, but it doesn't move when I move the trackpad (or external mouse). Non-dangerous key combinations like alt-tab don't nudge anything into appearing. However, nothing has crashed: I'm fortunate to have a laptop on which suspend/resume work, and if I close the laptop lid (which I have set to suspend) and re-open it a few seconds later to resume, the built-in display works again. I originally observed this with XFCE and speculated that it was an XFCE-specific issue, but have since switched over to MATE and the same problem occurs. I know it's not hardware related because until a few weeks ago I was running GhostBSD with MATE, and unplugging the monitor there did not do this (it did sometimes keep the external display "alive" after disconnect until I opened the display settings applet, but I digress).
Does anyone have any ideas how to diagnose and fix this? Is there some obvious setting I'm missing, either system-wide for Xorg or specific to MATE? Worst case I guess in principle I could dig into the suspend/resume scripts and see if there's something in there I could trigger from the console rather than suspending and resuming, but I'd rather just have the screen not go blank until I manually intervene.
Does anyone have any ideas how to diagnose and fix this? Is there some obvious setting I'm missing, either system-wide for Xorg or specific to MATE? Worst case I guess in principle I could dig into the suspend/resume scripts and see if there's something in there I could trigger from the console rather than suspending and resuming, but I'd rather just have the screen not go blank until I manually intervene.