mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-28 21:01:04 +00:00
Handle the case where the active window gets removed leaving us stuck
* When multiple windows are around if the active window gets removed we need to be careful when reassigning the active window.
This commit is contained in:
+10
-1
@@ -825,9 +825,18 @@ void RenderDoc::RemoveFrameCapturer(void *dev, void *wnd)
|
||||
if(m_ActiveWindow == dw)
|
||||
{
|
||||
if(m_WindowFrameCapturers.size() == 1)
|
||||
{
|
||||
m_ActiveWindow = DeviceWnd();
|
||||
}
|
||||
else
|
||||
m_ActiveWindow = m_WindowFrameCapturers.begin()->first;
|
||||
{
|
||||
auto it = m_WindowFrameCapturers.begin();
|
||||
// active window could be the first in our list, move
|
||||
// to second (we know from above there are at least 2)
|
||||
if(m_ActiveWindow == it->first)
|
||||
it++;
|
||||
m_ActiveWindow = it->first;
|
||||
}
|
||||
}
|
||||
|
||||
m_WindowFrameCapturers.erase(it);
|
||||
|
||||
Reference in New Issue
Block a user