From 8082e5955dc50f1e18809c693dace2310bfb1e62 Mon Sep 17 00:00:00 2001 From: niksedk Date: Sun, 17 May 2026 15:41:17 +0200 Subject: [PATCH] Bring Typewriter plugin window to foreground on launch The plugin process has no parent window relationship to Subtitle Edit, so on macOS (and sometimes Windows/Linux) the dialog opened behind SE and looked like nothing happened. Override OnOpened to briefly set Topmost=true and call Activate() so the window jumps to the top of the z-order with focus, then drop Topmost so the user can still put other windows over it. Bump plugin to 1.0.2 and point se5-plugins.json at the upcoming se5-typewriter-v1.0.2 release. Co-Authored-By: Claude Opus 4.7 (1M context) --- se5-plugins.json | 14 +++++++------- se5/TypewriterEffect/MainWindow.axaml.cs | 13 +++++++++++++ se5/TypewriterEffect/plugin.json | 2 +- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/se5-plugins.json b/se5-plugins.json index 65fc469..c34c129 100644 --- a/se5-plugins.json +++ b/se5-plugins.json @@ -3,18 +3,18 @@ { "name": "Typewriter effect", "description": "Splits each subtitle line into short timed parts that progressively reveal the text, character by character.", - "version": "1.0.1", + "version": "1.0.2", "author": "Subtitle Edit", "url": "https://github.com/SubtitleEdit/plugins/tree/main/se5/TypewriterEffect", "date": "2026-05-17", "minSeVersion": "5.0.0", "downloads": { - "win-x64": "https://github.com/SubtitleEdit/plugins/releases/download/se5-typewriter-v1.0.1/TypewriterEffect-win-x64.zip", - "win-arm64": "https://github.com/SubtitleEdit/plugins/releases/download/se5-typewriter-v1.0.1/TypewriterEffect-win-arm64.zip", - "linux-x64": "https://github.com/SubtitleEdit/plugins/releases/download/se5-typewriter-v1.0.1/TypewriterEffect-linux-x64.zip", - "linux-arm64": "https://github.com/SubtitleEdit/plugins/releases/download/se5-typewriter-v1.0.1/TypewriterEffect-linux-arm64.zip", - "osx-x64": "https://github.com/SubtitleEdit/plugins/releases/download/se5-typewriter-v1.0.1/TypewriterEffect-osx-x64.zip", - "osx-arm64": "https://github.com/SubtitleEdit/plugins/releases/download/se5-typewriter-v1.0.1/TypewriterEffect-osx-arm64.zip" + "win-x64": "https://github.com/SubtitleEdit/plugins/releases/download/se5-typewriter-v1.0.2/TypewriterEffect-win-x64.zip", + "win-arm64": "https://github.com/SubtitleEdit/plugins/releases/download/se5-typewriter-v1.0.2/TypewriterEffect-win-arm64.zip", + "linux-x64": "https://github.com/SubtitleEdit/plugins/releases/download/se5-typewriter-v1.0.2/TypewriterEffect-linux-x64.zip", + "linux-arm64": "https://github.com/SubtitleEdit/plugins/releases/download/se5-typewriter-v1.0.2/TypewriterEffect-linux-arm64.zip", + "osx-x64": "https://github.com/SubtitleEdit/plugins/releases/download/se5-typewriter-v1.0.2/TypewriterEffect-osx-x64.zip", + "osx-arm64": "https://github.com/SubtitleEdit/plugins/releases/download/se5-typewriter-v1.0.2/TypewriterEffect-osx-arm64.zip" } }, { diff --git a/se5/TypewriterEffect/MainWindow.axaml.cs b/se5/TypewriterEffect/MainWindow.axaml.cs index 6f9eba6..38abb10 100644 --- a/se5/TypewriterEffect/MainWindow.axaml.cs +++ b/se5/TypewriterEffect/MainWindow.axaml.cs @@ -36,6 +36,19 @@ private void InitializeComponent() _endDelayInput = this.FindControl("EndDelayInput")!; } + protected override void OnOpened(EventArgs e) + { + base.OnOpened(e); + + // The plugin is a fresh process with no parent window relationship to + // Subtitle Edit, so on macOS/Linux/sometimes Windows it can appear + // behind SE. Toggling Topmost briefly forces the window to the top of + // the z-order, and Activate() gives it focus. + Topmost = true; + Activate(); + Topmost = false; + } + private void OnCancel(object? sender, RoutedEventArgs e) { App.Response = new PluginResponse { Status = "cancelled" }; diff --git a/se5/TypewriterEffect/plugin.json b/se5/TypewriterEffect/plugin.json index 8e6e267..c073426 100644 --- a/se5/TypewriterEffect/plugin.json +++ b/se5/TypewriterEffect/plugin.json @@ -2,7 +2,7 @@ "apiVersion": 1, "name": "Typewriter effect", "description": "Splits each subtitle line into short timed parts that progressively reveal the text, character by character.", - "version": "1.0.1", + "version": "1.0.2", "author": "Subtitle Edit", "url": "https://github.com/SubtitleEdit/plugins/tree/main/se5/TypewriterEffect", "menu": "Tools",