From 4994d6248d1b11321db3f247a126bcaa0a36a2f5 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: Sun, 14 Apr 2024 14:25:06 +0800 Subject: [PATCH] Update translatorUI.py --- LunaTranslator/LunaTranslator/gui/translatorUI.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/LunaTranslator/LunaTranslator/gui/translatorUI.py b/LunaTranslator/LunaTranslator/gui/translatorUI.py index 54fa6007..27b33669 100644 --- a/LunaTranslator/LunaTranslator/gui/translatorUI.py +++ b/LunaTranslator/LunaTranslator/gui/translatorUI.py @@ -567,7 +567,19 @@ class QUnFrameWindow(resizableframeless): windows.GetWindowLong(int(self.winId()), windows.GWL_EXSTYLE) & windows.WS_EX_TOPMOST ) == 0: - self.canceltop() + windows.SetWindowPos( + int(self.winId()), + windows.HWND_NOTOPMOST, + 0, + 0, + 0, + 0, + windows.SWP_NOACTIVATE | windows.SWP_NOSIZE | windows.SWP_NOMOVE, + ) + HWNDStyleEx = windows.GetWindowLong(int(self.winId()), windows.GWL_EXSTYLE) + windows.SetWindowLong( + int(self.winId()), windows.GWL_EXSTYLE, HWNDStyleEx & ~windows.WS_EX_TOPMOST + ) HWNDStyleEx = windows.GetWindowLong(int(self.winId()), windows.GWL_EXSTYLE) windows.SetWindowLong( int(self.winId()), windows.GWL_EXSTYLE, HWNDStyleEx | windows.WS_EX_TOPMOST