Annoying external monitor issues

My work laptop has this annoying issue where sometimes the external monitors don't disconnect when I unplug them.  I have two external monitors that I connect to it via a USB-C hub.  It works pretty well most of the time, but every now and then it will lose the external monitors.  This comes in two flavors:

  1. The hub is plugged in, but the monitors disconnect.
  2. I've unplugged the hub, but Windows still thinks the monitors are connected.

Case 1 is simple enough to deal with - just unplug the hub, wait a few seconds until I hear the notification for the device being unplugged, and then plug it back in.

The second case is kind of annoying.  Because Windows still thinks the monitors are attached, it doesn't reposition any windows.  That means I'll be using just my laptop screen, but most of my work is sitting off-screen on non-existent monitors.  I've tried explicitly disconnecting the monitors through the display settings, but it doesn't work - literally nothing changes and Windows still thinks they're connected.

The only solution I've found for this is manually moving the windows.  In the old days, you could just right-click the task bar icon and get a menu with the "move" item in it.  But that's gone now.  Instead, you have to select the window in the task bar to make it active, then press "Alt+Space, M" to move the window and then use the arrow keys and mouse to get it on the screen.  Unless it's maximized, in which case "move" isn't available.  For that case, you have to do "Alt+Space, R" to restore it and then press "Alt+Space, M" to move it.

That last part I didn't actually realize until just now, when this happened and I was trying to figure out why the "move" trick only worked for some of the windows.  Sigh....