Skip to content

Commit

Permalink
fix: ...
Browse files Browse the repository at this point in the history
  • Loading branch information
eee555 committed Jul 11, 2024
1 parent 1404bb5 commit 243ea85
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
SetWindowDisplayAffinity.argtypes = ctypes.wintypes.HWND, ctypes.wintypes.DWORD
SetWindowDisplayAffinity.restype = ctypes.wintypes.BOOL
ui.hwnd = FindWindow(None, "元扫雷")
ui.SetWindowDisplayAffinity = SetWindowDisplayAffinity


sys.exit(app.exec_())
Expand Down
12 changes: 7 additions & 5 deletions src/mineSweeperGUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,12 @@ def mineAreaLeftRelease(self, i, j):
self.layMine(i // self.pixSize, j // self.pixSize)
self.game_state = 'playing'

self.SetWindowDisplayAffinity = ctypes.windll.user32.SetWindowDisplayAffinity
self.SetWindowDisplayAffinity.argtypes = ctypes.wintypes.HWND, ctypes.wintypes.DWORD
self.SetWindowDisplayAffinity.restype = ctypes.wintypes.BOOL
if not self.SetWindowDisplayAffinity(self.hwnd, 0x00000011):
raise ctypes.WinError()
if self.player_designator[:6] != "[live]":
if not self.SetWindowDisplayAffinity(self.hwnd, 0x00000011):
raise ctypes.WinError()
else:
if not self.SetWindowDisplayAffinity(self.hwnd, 0x00000000):
raise ctypes.WinError()
# print('failed', ctypes.get_last_error())
# raise ctypes.WinError()

Expand Down Expand Up @@ -1157,6 +1158,7 @@ def hidden_score_board(self):
else:
self.score_board_manager.visible()


def closeEvent_(self):
# 主窗口关闭的回调
self.score_board_manager.close()
Expand Down

0 comments on commit 243ea85

Please sign in to comment.