]> granicus.if.org Git - handbrake/commitdiff
WinGui: Focus the preview window when the button is pressed while it is still open.
authorsr55 <sr55.hb@outlook.com>
Fri, 14 Dec 2018 21:00:21 +0000 (21:00 +0000)
committersr55 <sr55.hb@outlook.com>
Fri, 14 Dec 2018 21:00:21 +0000 (21:00 +0000)
win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs

index a64e0cb39378797c628a846b27909c248edad8db..3673180804530ce171e5ec91124e2f4fd76dd00e 100644 (file)
@@ -1463,6 +1463,11 @@ namespace HandBrakeWPF.ViewModels
                 this.StaticPreviewViewModel.UpdatePreviewFrame(this.CurrentTask, this.ScannedSource);\r
                 this.windowManager.ShowWindow(this.StaticPreviewViewModel);\r
             }\r
+            else if (this.StaticPreviewViewModel.IsOpen)\r
+            {\r
+                Window window = Application.Current.Windows.Cast<Window>().FirstOrDefault(x => x.GetType() == typeof(StaticPreviewView));\r
+                window?.Focus();\r
+            }\r
         }\r
 \r
         public void ShowPresetPane()\r