This commit is contained in:
2026-05-20 00:09:28 +02:00
parent 968bf7d102
commit 51b5ddc6f2
695 changed files with 999722 additions and 270 deletions

View File

@@ -521,7 +521,7 @@ class EmpfangWebviewApi:
full = urlunparse(p._replace(query=urlencode(qs, doseq=True)))
except Exception:
full = url
w, h = 600, 820
w, h = 350, 700
# MiniChat erbt das effektive Profil seines Parents (nicht "minichat" selbst).
parent_mode = _effective_profile_mode(self._mode, self._parent_mode_hint)
@@ -784,6 +784,12 @@ class EmpfangWebviewApi:
sw_restore = 9
user32.ShowWindow(hwnd, sw_restore)
user32.SetForegroundWindow(hwnd)
time.sleep(0.12)
try:
user32.ShowWindow(hwnd, sw_restore)
user32.SetForegroundWindow(hwnd)
except Exception:
pass
except Exception as exc:
print(
f"[empfang] bring_to_front failed: {type(exc).__name__}",
@@ -963,11 +969,11 @@ def main(argv: list[str] | None = None) -> int:
# Default-Groessen pro Modus:
# desktop_shell -> 1180 x 820 (unveraendert)
# empfang_chat_shell -> 900 x 650 (~70% Flaeche; Chat/Eingabe weiter brauchbar)
# minichat -> 600 x 820 (wie bisher; nur ueber subprocess gesetzt)
# minichat -> 350 x 700 (argv groessen haben vorrang, z. B. open_minichat)
if mode == _MODE_EMPFANG_CHAT_SHELL:
default_w, default_h = 900, 650
elif mode == _MODE_MINICHAT:
default_w, default_h = 600, 820
default_w, default_h = 350, 700
else:
default_w, default_h = 1180, 820
# Explizit per argv uebergebene Groesse (z.B. open_minichat) hat Vorrang.
@@ -1023,6 +1029,13 @@ def main(argv: list[str] | None = None) -> int:
)
api.bind_window(win)
webview.start(**start_kw)
# Onefile: Bootloader raeumt %TEMP%\\_MEI* nach Beenden. WebView2 gibt
# DLL-Handles oft verzoegert frei — kurze Pause verringert Warn-Dialoge.
if getattr(sys, "frozen", False) and sys.platform == "win32":
try:
time.sleep(0.45)
except Exception:
pass
return 0
except Exception as exc:
print(str(exc), file=sys.stderr)