Skip to content

Commit

Permalink
improves speed by 3x
Browse files Browse the repository at this point in the history
  • Loading branch information
cybrdelic committed Nov 11, 2023
1 parent f35747b commit 28545cf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions utils/window_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def _wait_for_window_handle(self, title):
hwnd = self._get_window_handle(title)
if hwnd:
return hwnd
time.sleep(0.5) # Check every 0.5 seconds
time.sleep(0.2) # Check every 0.5 seconds
return None

def _get_window_handle(self, title):
Expand All @@ -52,7 +52,7 @@ def _move_window_to_monitor(self, hwnd, monitor_number):
if not is_maximized:
win32gui.SetWindowPos(hwnd, win32con.HWND_TOP, -32000, -32000, 0, 0, win32con.SWP_SHOWWINDOW)
print("Window moved off-screen")
time.sleep(0.5)
time.sleep(0.2) # Reduced sleep time

# Enumerate monitors and move the window to the desired monitor
monitors = win32api.EnumDisplayMonitors()
Expand All @@ -61,7 +61,7 @@ def _move_window_to_monitor(self, hwnd, monitor_number):
monitor_area = monitor_info['Monitor']
win32gui.SetWindowPos(hwnd, win32con.HWND_TOP, monitor_area[0], monitor_area[1], 0, 0, win32con.SWP_SHOWWINDOW)
print(f"Window moved to monitor {monitor_number}")
time.sleep(0.5)
time.sleep(0.2) # Reduced sleep time
else:
print("Monitor number out of range")

Expand Down

0 comments on commit 28545cf

Please sign in to comment.