Win32CaptureSample icon indicating copy to clipboard operation
Win32CaptureSample copied to clipboard

GraphicsCapturePicker breaks Windows Explorer after display is unplugged

Open DonFreiling opened this issue 5 years ago • 4 comments

System Info: Windows 10 Pro x64 10.0.19041 running on Lenovo L540 Visusal Studio 2019 V16.8.2 Windows SDK: 10.0.19041.0 Platform Toolset: VS 2019 (v142) Microsoft.Windows.CppWinRT nuget package v2.0.201217.4

Laptop has 2 external displays plugged in.

Repro Steps:

  1. Get and build Win32CaptureSample-master
  2. Start the app and press "Open Picker" to show the GraphicsCapturePicker popup
  3. Unplug one of the external displays
  4. Press cancel on the GraphicsCapturePicker popup

At this point Windows Explorer is in a bad state. Clicking Windows Icon in the task bar does not bring up the start menu. Right clicking any of the app icons in the task bar does not bring up the context menu. Clicking the "Open Picker" button on the Win32CaptureSample app brings up the GraphicsCapturePicker but with no content (see attached image). It was necessary to restart Windows Explorer from the Task Manager in order to recover.

Running the same steps as above with only 1 external display will result in Win32CaptureSample throwing an exception when the display is unplugged (see attached image) CaptureSampleException CaptureSampleBlankPicker

.

DonFreiling avatar Jan 20 '21 17:01 DonFreiling

Thanks for reporting this!

robmikh avatar Jan 21 '21 01:01 robmikh

Hmmm... I'm not able to reproduce this with my Surface Laptop. There is a problem, the application crashes for me, but it doesn't leave explorer in a bad state. I haven't attached a debugger yet, that might yield more answers.

robmikh avatar Jan 22 '21 21:01 robmikh

MonitorList has a pretty silly bug in it... but it's not something that should put Explorer in a bad state. I'll fix that issue first and we'll see if the other issue manifests.

robmikh avatar Jan 22 '21 22:01 robmikh

I think I can reproduce the original issue, I'll need to do some debugging to see if it's actually related. I'm not sure what I saw before, but I can't see the bug in MonitorList that I was convinced of.

robmikh avatar May 13 '22 08:05 robmikh