v1.9.18: revert GUI to v1.9.14 state — fix broken window display
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
32
gui/app.py
32
gui/app.py
@@ -3,7 +3,6 @@ Main application window — sidebar + tabview layout.
|
||||
"""
|
||||
|
||||
import tkinter
|
||||
import sys
|
||||
import customtkinter as ctk
|
||||
from tkinter import messagebox
|
||||
|
||||
@@ -119,37 +118,6 @@ class App(ctk.CTk):
|
||||
# Cleanup on close
|
||||
self.protocol("WM_DELETE_WINDOW", self._on_close)
|
||||
|
||||
# Fix: restore window after Win+D (Show Desktop)
|
||||
self.bind("<Map>", self._on_map, add="+")
|
||||
if sys.platform == "win32":
|
||||
self._setup_win32_restore()
|
||||
|
||||
def _on_map(self, event=None):
|
||||
"""Ensure window is fully visible when restored from taskbar."""
|
||||
try:
|
||||
self.deiconify()
|
||||
self.lift()
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
def _setup_win32_restore(self):
|
||||
"""Win32 fallback: periodic check for stuck minimized state."""
|
||||
import ctypes
|
||||
self._user32 = ctypes.windll.user32
|
||||
self._hwnd = int(self.wm_frame(), 16)
|
||||
self._check_minimized()
|
||||
|
||||
def _check_minimized(self):
|
||||
"""If window is iconic but should be visible, force restore."""
|
||||
try:
|
||||
if self._user32.IsIconic(self._hwnd):
|
||||
fg = self._user32.GetForegroundWindow()
|
||||
if fg == self._hwnd:
|
||||
self._user32.ShowWindow(self._hwnd, 9) # SW_RESTORE
|
||||
except Exception:
|
||||
pass
|
||||
self.after(500, self._check_minimized)
|
||||
|
||||
def _build_layout(self):
|
||||
# PanedWindow — resizable sidebar | main area
|
||||
self._paned = tkinter.PanedWindow(
|
||||
|
||||
Reference in New Issue
Block a user