mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-07-20 22:41:36 +00:00
Don't close the live capture while a menu might still be open.
This commit is contained in:
@@ -239,7 +239,9 @@ void LiveCapture::on_captures_mouseClicked(QMouseEvent *e)
|
||||
QObject::connect(&contextDeleteAction, &QAction::triggered, this,
|
||||
&LiveCapture::deleteCapture_triggered);
|
||||
|
||||
m_ContextMenu = &contextMenu;
|
||||
RDDialog::show(&contextMenu, QCursor::pos());
|
||||
m_ContextMenu = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -961,7 +963,7 @@ void LiveCapture::connectionClosed()
|
||||
// then don't close just yet.
|
||||
if(ui->captures->count() == 1 || m_Children.count() == 0)
|
||||
{
|
||||
ToolWindowManager::closeToolWindow(this);
|
||||
selfClose();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -973,12 +975,30 @@ void LiveCapture::connectionClosed()
|
||||
LiveCapture *live =
|
||||
new LiveCapture(m_Ctx, m_Hostname, m_HostFriendlyname, m_Children[0].ident, m_Main);
|
||||
m_Main->ShowLiveCapture(live);
|
||||
ToolWindowManager::closeToolWindow(this);
|
||||
selfClose();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LiveCapture::selfClose()
|
||||
{
|
||||
if(m_ContextMenu)
|
||||
{
|
||||
qInfo() << "preventing race";
|
||||
// hide the menu and close our window shortly after
|
||||
m_ContextMenu->close();
|
||||
QTimer *timer = new QTimer(this);
|
||||
QObject::connect(timer, &QTimer::timeout, [this]() { ToolWindowManager::closeToolWindow(this); });
|
||||
timer->setSingleShot(true);
|
||||
timer->start(250);
|
||||
}
|
||||
else
|
||||
{
|
||||
ToolWindowManager::closeToolWindow(this);
|
||||
}
|
||||
}
|
||||
|
||||
void LiveCapture::connectionThreadEntry()
|
||||
{
|
||||
m_Connection = RENDERDOC_CreateTargetControl(m_Hostname.toUtf8().data(), m_RemoteIdent,
|
||||
|
||||
@@ -125,6 +125,9 @@ private:
|
||||
const rdctype::array<byte> &thumbnail, int32_t thumbWidth, int32_t thumbHeight,
|
||||
QDateTime timestamp, const QString &path, bool local);
|
||||
void connectionClosed();
|
||||
|
||||
void selfClose();
|
||||
|
||||
void killThread();
|
||||
|
||||
void setTitle(const QString &title);
|
||||
@@ -157,6 +160,8 @@ private:
|
||||
bool m_IgnoreThreadClosed = false;
|
||||
bool m_IgnorePreviewToggle = false;
|
||||
|
||||
QMenu *m_ContextMenu = NULL;
|
||||
|
||||
QAction *previewToggle;
|
||||
QToolButton *openButton;
|
||||
QAction *newWindowAction;
|
||||
|
||||
Reference in New Issue
Block a user