Skip to content

Commit

Permalink
修复了由显示器分辨率过低引发的无限窗口大小警告的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Zzaphkiel committed Aug 5, 2024
1 parent ae91ca1 commit f016b81
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/view/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -948,8 +948,11 @@ async def __onGameEnd(self):
asyncio.create_task(self.gameInfoInterface.clear())

def __checkWindowSize(self):
if (dpi := self.devicePixelRatioF()) == 1.0:
return

w, h = win32api.GetSystemMetrics(0), win32api.GetSystemMetrics(1)
size: QSize = self.size() * self.devicePixelRatioF()
size: QSize = self.size() * dpi

if size.width() < w and size.height() < h:
return
Expand Down

0 comments on commit f016b81

Please sign in to comment.