v1.9.15: fix minimize/restore — remove grab_set, add Win32 restore fallback

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
chrome-storm-c442
2026-03-05 03:58:32 -05:00
parent f9a81a4825
commit 01ab318e4b
7 changed files with 79 additions and 44 deletions

View File

@@ -15,10 +15,12 @@ class AboutDialog(ctk.CTkToplevel):
self.geometry("500x480")
self.resizable(False, False)
self.transient(master)
self.grab_set()
self.focus_force()
self.protocol("WM_DELETE_WINDOW", self._on_close)
self._master_ref = master
self._map_bind_id = master.bind("<Map>", self._on_parent_map, add="+")
# ── Header ──
ctk.CTkLabel(
self, text=t("about_title"),
@@ -78,9 +80,20 @@ class AboutDialog(ctk.CTkToplevel):
self, text=t("close"), width=120, command=self._on_close
).pack(pady=(10, 20))
def _on_parent_map(self, event=None):
"""Restore dialog when parent is un-minimized."""
try:
if not self.winfo_exists():
return
self.deiconify()
self.lift()
self.focus_force()
except Exception:
pass
def _on_close(self):
try:
self.grab_release()
self._master_ref.unbind("<Map>", self._map_bind_id)
except Exception:
pass
self.destroy()