Fix minor issues
This commit is contained in:
@@ -182,7 +182,7 @@ class MacOSWindowTracker(threading.Thread):
|
|||||||
if len(window_list) > 0:
|
if len(window_list) > 0:
|
||||||
found = True
|
found = True
|
||||||
is_active = False
|
is_active = False
|
||||||
if self.window_active != is_active:
|
if found and self.window_active != is_active:
|
||||||
on_window_activated(is_active)
|
on_window_activated(is_active)
|
||||||
self.window_active = is_active
|
self.window_active = is_active
|
||||||
time.sleep(0.2)
|
time.sleep(0.2)
|
||||||
@@ -202,8 +202,10 @@ class WindowsWindowTracker(threading.Thread):
|
|||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
found = True
|
found = True
|
||||||
while found and not self.stop:
|
while not self.stop:
|
||||||
found = win32gui.IsWindow(self.window_handle)
|
found = win32gui.IsWindow(self.window_handle)
|
||||||
|
if not found:
|
||||||
|
break
|
||||||
if self.only_active:
|
if self.only_active:
|
||||||
is_active = self.window_handle == win32gui.GetForegroundWindow()
|
is_active = self.window_handle == win32gui.GetForegroundWindow()
|
||||||
if self.window_active != is_active:
|
if self.window_active != is_active:
|
||||||
|
|||||||
Reference in New Issue
Block a user