From 4ef1ce0c6b969a29b0910f9b71dc571a46cc8c0b Mon Sep 17 00:00:00 2001 From: Jeremy Shen Date: Thu, 11 Jun 2026 18:24:42 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20UART=20window=20stability=20on=20Windows?= =?UTF-8?q?=20=E2=80=94=20lift/focus,=20remove=20stray=20grab=5Frelease?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CTkToplevel on Windows can fail to display (flash then disappear) without explicit lift()/focus(). Also removed grab_release() call in _on_close since grab_set() was never called — calling release without a matching grab can cause issues on some Windows tkinter builds. --- src/gui/widgets.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/widgets.py b/src/gui/widgets.py index 420807b..c3144b4 100644 --- a/src/gui/widgets.py +++ b/src/gui/widgets.py @@ -953,6 +953,8 @@ class UartMonitorWindow(ctk.CTkToplevel): self.geometry("680x540") self.minsize(480, 360) self.protocol("WM_DELETE_WINDOW", self._on_close) + self.lift() # ensure visible on Windows + self.focus() self._on_log = on_log @@ -1201,5 +1203,4 @@ class UartMonitorWindow(ctk.CTkToplevel): if self._monitor: self._monitor.stop() self._monitor = None - self.grab_release() self.destroy()