Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix windowed mode wrong dimensions #85

Merged
merged 1 commit into from
Nov 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/utils/window.py
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
from dataclasses import dataclass
import time
import psutil
from win32gui import GetWindowText, EnumWindows, GetWindowRect
from win32gui import GetWindowText, EnumWindows, GetClientRect
from win32process import GetWindowThreadProcessId
from logger import Logger
from utils.misc import wait
@@ -78,7 +78,7 @@ def detect_window(window_spec: WindowSpec = D4_WINDOW):
def find_and_set_window_position(window_spec: WindowSpec = D4_WINDOW):
hwnd = get_window_spec_id(window_spec)
if hwnd is not None:
pos = GetWindowRect(hwnd)
pos = GetClientRect(hwnd)
Cam().update_window_pos(pos[0], pos[1], pos[2] - pos[0], pos[3] - pos[1])
wait(0.5)