From 90beef8f3c9708aea1c9016882eec517b060ed36 Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 29 Aug 2016 19:42:48 +0200 Subject: [PATCH] Allow live capture windows to stay open if switching ctx to that host --- renderdocui/Windows/Dialogs/LiveCapture.cs | 8 ++++++++ renderdocui/Windows/MainWindow.cs | 19 +++++++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/renderdocui/Windows/Dialogs/LiveCapture.cs b/renderdocui/Windows/Dialogs/LiveCapture.cs index 616996527..69dcf1ce5 100644 --- a/renderdocui/Windows/Dialogs/LiveCapture.cs +++ b/renderdocui/Windows/Dialogs/LiveCapture.cs @@ -133,6 +133,14 @@ namespace renderdocui.Windows m_QueueCapture = true; } + public string Hostname + { + get + { + return m_Host; + } + } + private void LiveCapture_Shown(object sender, EventArgs e) { m_ConnectThread = Helpers.NewThread(new ThreadStart(ConnectionThreadEntry)); diff --git a/renderdocui/Windows/MainWindow.cs b/renderdocui/Windows/MainWindow.cs index 4b02881e1..e2d6fcceb 100644 --- a/renderdocui/Windows/MainWindow.cs +++ b/renderdocui/Windows/MainWindow.cs @@ -1130,22 +1130,38 @@ namespace renderdocui.Windows if(item == null) return; + RemoteHost host = item.Tag as RemoteHost; + foreach (var live in m_LiveCaptures) + { + // allow live captures to this host to stay open, that way + // we can connect to a live capture, then switch into that + // context + if (live.Hostname == host.Hostname) + continue; + if (live.CheckAllowClose() == false) return; + } if (!PromptCloseLog()) return; foreach (var live in m_LiveCaptures.ToArray()) { + // allow live captures to this host to stay open, that way + // we can connect to a live capture, then switch into that + // context + if (live.Hostname == host.Hostname) + continue; + live.CleanItems(); live.Close(); } m_Core.Renderer.DisconnectFromRemoteServer(); - if (item.Tag == null) + if (host == null) { contextChooser.Image = global::renderdocui.Properties.Resources.house; contextChooser.Text = "Replay Context: Local"; @@ -1158,7 +1174,6 @@ namespace renderdocui.Windows } else { - RemoteHost host = item.Tag as RemoteHost; contextChooser.Text = "Replay Context: " + host.Hostname; contextChooser.Image = host.ServerRunning ? global::renderdocui.Properties.Resources.connect