Skip to content

Commit 4668567

Browse files
authored
Avoid UCEERR_RENDERTHREADFAILURE (#10394)
Fix #9042
1 parent aa72387 commit 4668567

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Microsoft.DotNet.Wpf/src/WpfGfx/core/hw/InteropDeviceBitmap.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -845,6 +845,10 @@ CInteropDeviceBitmap::GetDisplayFromUserDevice(
845845
IFC(pID3DUserDevice->GetDirect3D(&pID3DUserObject));
846846

847847
HMONITOR hMon = pID3DUserObject->GetAdapterMonitor(m_uAdapter);
848+
if(hMon == NULL)
849+
{
850+
hMon = ::MonitorFromWindow(NULL, MONITOR_DEFAULTTOPRIMARY);
851+
}
848852

849853
g_DisplayManager.GetCurrentDisplaySet(&pDisplaySet);
850854
UINT uDisplayIndex;

0 commit comments

Comments
 (0)