From 1d0bd43191921d01b2d4d69fa0b04fecf9c2c555 Mon Sep 17 00:00:00 2001 From: sr55 Date: Fri, 14 Dec 2018 21:00:21 +0000 Subject: WinGui: Focus the preview window when the button is pressed while it is still open. --- win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'win') diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index a64e0cb39..367318080 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -1463,6 +1463,11 @@ namespace HandBrakeWPF.ViewModels this.StaticPreviewViewModel.UpdatePreviewFrame(this.CurrentTask, this.ScannedSource); this.windowManager.ShowWindow(this.StaticPreviewViewModel); } + else if (this.StaticPreviewViewModel.IsOpen) + { + Window window = Application.Current.Windows.Cast().FirstOrDefault(x => x.GetType() == typeof(StaticPreviewView)); + window?.Focus(); + } } public void ShowPresetPane() -- cgit v1.2.3