mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-07-20 22:41:36 +00:00
Ensure replay loop is cancelled before window is hidden
* See also f56a989e4f - we don't want to make the replay loop always on
top though
This commit is contained in:
@@ -2588,7 +2588,7 @@ void MainWindow::on_action_Start_Replay_Loop_triggered()
|
||||
if(!m_Ctx.IsCaptureLoaded())
|
||||
return;
|
||||
|
||||
QDialog popup;
|
||||
RDDialog popup;
|
||||
popup.setWindowFlags(popup.windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
popup.setWindowIcon(windowIcon());
|
||||
|
||||
@@ -2651,6 +2651,13 @@ void MainWindow::on_action_Start_Replay_Loop_triggered()
|
||||
|
||||
m_Ctx.Replay().AsyncInvoke([winData, id](IReplayController *r) { r->ReplayLoop(winData, id); });
|
||||
|
||||
QObject::connect(&popup, &RDDialog::aboutToClose,
|
||||
[this](QCloseEvent *) { m_Ctx.Replay().CancelReplayLoop(); });
|
||||
QObject::connect(&popup, &RDDialog::keyPress, [this](QKeyEvent *e) {
|
||||
if(e->matches(QKeySequence::Cancel))
|
||||
m_Ctx.Replay().CancelReplayLoop();
|
||||
});
|
||||
|
||||
RDDialog::show(&popup);
|
||||
|
||||
m_Ctx.Replay().CancelReplayLoop();
|
||||
|
||||
Reference in New Issue
Block a user