Skip to content

The only downloader you need. 下载器的集大成者。

refactor(desktop): 删掉没人调用的 requestForeground

XiaoYouChR4e83ee097aab
diff --git a/app/platform/desktop.py b/app/platform/desktop.py
index 27dc7f52..5f9f87ce 100644
--- a/app/platform/desktop.py
+++ b/app/platform/desktop.py
@@ -233,36 +233,6 @@ def openChromiumUrl(url: str) -> bool:
return False
-def requestForeground() -> None:
- if sys.platform != "win32":
- return
- try:
- import win32api
- import win32con
- import win32gui
- import win32process
-
- hwnd = win32gui.FindWindow(None, "Ghost Downloader")
- if not hwnd:
- return
- foregroundHwnd = win32gui.GetForegroundWindow()
- if not foregroundHwnd or foregroundHwnd == hwnd:
- return
- foregroundThreadId = win32process.GetWindowThreadProcessId(foregroundHwnd)[0]
- currentThreadId = win32api.GetCurrentThreadId()
- attached = False
- try:
- if foregroundThreadId != currentThreadId:
- win32process.AttachThreadInput(currentThreadId, foregroundThreadId, True)
- attached = True
- win32gui.SetForegroundWindow(hwnd)
- finally:
- if attached:
- win32process.AttachThreadInput(currentThreadId, foregroundThreadId, False)
- except Exception:
- pass
-
-
def raiseWindow(window: QWidget) -> None:
_sendForegroundInput()
window.show()