Skip to content

Commit

Permalink
Fix DPI warnings and update upstream issues list
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam committed Jun 11, 2023
1 parent 22fc606 commit 0ddf647
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
3 changes: 1 addition & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
# Workaround for https://github.com/adamchainz/pre-commit-dprint/issues/4
- id: pretty-format-json
exclude: ".vscode/.*|dprint.json" # Exclude jsonc
exclude: ".vscode/.*" # Exclude jsonc
args: [--autofix, --no-sort-keys]
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,18 +239,16 @@ Not a developer? You can still help through the following methods:
- [Upvoting feature requests](../../issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc+label%3Aenhancement) you are interested in
- Sharing AutoSplit with other speedrunners
- Upvoting the following upstream issues in libraries and tools we use:
- <https://github.com/opencv/opencv/issues/created_by/Avasam>
- <https://github.com/opencv/opencv/issues/23539>
- <https://github.com/opencv/opencv/issues/14590>
- <https://github.com/opencv/opencv/pull/20370>
- <https://github.com/opencv/opencv/issues/23537>
- <https://github.com/opencv/opencv/issues/23158>
- <https://github.com/pywinrt/python-winsdk/issues/11>
- <https://github.com/adamchainz/pre-commit-dprint/issues/4>
- <https://github.com/microsoft/vscode/issues/40239>
- <https://github.com/boppreh/keyboard/issues/171>
- <https://github.com/boppreh/keyboard/issues/516>
- <https://github.com/boppreh/keyboard/issues/216>
- <https://github.com/boppreh/keyboard/issues/161>
- <https://github.com/asweigart/pyautogui/issues/663>

## Credits

Expand Down
2 changes: 0 additions & 2 deletions src/AutoSplit.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@
os.environ["REQUESTS_CA_BUNDLE"] = certifi.where()
myappid = f"Toufool.AutoSplit.v{AUTOSPLIT_VERSION}"
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(myappid)
# qt.qpa.window: SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2) failed: COM error 0x5: Access is denied. # noqa: E501
# ctypes.windll.user32.SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2)


class AutoSplit(QMainWindow, design.Ui_MainWindow):
Expand Down
8 changes: 7 additions & 1 deletion src/hotkeys.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@

from collections.abc import Callable
from typing import TYPE_CHECKING, Literal, cast
from unittest.mock import patch

import keyboard
import pyautogui
from PySide6 import QtWidgets

import error_messages
from utils import fire_and_forget, is_digit

# Prevent pyautogui from setting Process DPI Awareness,
# which Qt tries to do then throws warnings about it
# https://github.com/asweigart/pyautogui/issues/663#issuecomment-1296719464
with patch("ctypes.windll.user32.SetProcessDPIAware", autospec=True):
import pyautogui

if TYPE_CHECKING:
from AutoSplit import AutoSplit

Expand Down

0 comments on commit 0ddf647

Please sign in to comment.