From 8321013353b6bd57470b3916aba793c6548fe851 Mon Sep 17 00:00:00 2001 From: Zzaphkiel Date: Wed, 12 Jun 2024 17:30:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=BE=9D=E8=B5=96=E9=87=8C?= =?UTF-8?q?=E4=B8=8D=E9=9C=80=E8=A6=81=E7=9A=84=20`pygetwindow`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/view/main_window.py | 29 ----------------------------- requirements.txt | 1 - 2 files changed, 30 deletions(-) diff --git a/app/view/main_window.py b/app/view/main_window.py index 6e2ef15..3a7eafe 100644 --- a/app/view/main_window.py +++ b/app/view/main_window.py @@ -10,7 +10,6 @@ import asyncio from aiohttp.client_exceptions import ClientConnectorError from qasync import asyncClose, asyncSlot -import pygetwindow as gw from PyQt5.QtCore import Qt, pyqtSignal, QSize from PyQt5.QtGui import QIcon, QImage from PyQt5.QtWidgets import QApplication, QSystemTrayIcon @@ -360,34 +359,6 @@ def __showWaitingMessageBox(self): signalBus.terminateListeners.emit() sys.exit() - def gameStartMinimize(self): - srcWindow = None - - while True: - time.sleep(1) - - if not cfg.get(cfg.enableGameStartMinimize): - continue - activaWindow = gw.getActiveWindow() - - if not activaWindow: - continue - activeWindowTitle = activaWindow.title - - # 有窗口切换发生, 并且与 LOL 有关 - if (srcWindow != activeWindowTitle - and "League of Legends (TM) Client" in (activeWindowTitle, srcWindow)): - - # 进入游戏窗口, 隐藏 Seraphine - if srcWindow == "League of Legends (TM) Client": - self.mainWindowHide.emit(False) - else: - # 切出游戏窗口, 显示 Seraphine - self.mainWindowHide.emit(True) - # self.activateWindow() - - srcWindow = activeWindowTitle - def __initSystemTray(self): self.trayIcon = QSystemTrayIcon(self) self.trayIcon.setToolTip("Seraphine") diff --git a/requirements.txt b/requirements.txt index 9b478e8..d17f61e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,6 +4,5 @@ PyQt5-sip==12.12.1 PyQt-Fluent-Widgets==1.5.7 Requests==2.32.3 aiohttp==3.9.5 -pygetwindow==0.0.9 psutil==5.9.8 qasync==0.27.1 \ No newline at end of file