From fa74659b3fb0c79afbc248f8f26a2ff1bae56099 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <101191390+HIllya51@users.noreply.github.com> Date: Wed, 28 Aug 2024 02:28:48 +0800 Subject: [PATCH] fix --- LunaTranslator/LunaTranslator/myutils/utils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/LunaTranslator/LunaTranslator/myutils/utils.py b/LunaTranslator/LunaTranslator/myutils/utils.py index d399ac65..92825f65 100644 --- a/LunaTranslator/LunaTranslator/myutils/utils.py +++ b/LunaTranslator/LunaTranslator/myutils/utils.py @@ -439,6 +439,10 @@ def minmaxmoveobservefunc(self): gobject.baseobject.hwnd = None return p_pids = windows.GetWindowThreadProcessId(gobject.baseobject.hwnd) + if not p_pids: + # 有时候谜之没有EVENT_OBJECT_DESTROY/僵尸进程 + gobject.baseobject.hwnd = None + return _focusp = windows.GetWindowThreadProcessId(hwnd) if event != windows.EVENT_SYSTEM_FOREGROUND: return