Skip to content

Commit

Permalink
Fix weird random bug
Browse files Browse the repository at this point in the history
  • Loading branch information
marticliment committed Oct 30, 2021
1 parent e5f1eb6 commit e395b01
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions elevenclock/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,9 @@ def __init__(self, dpix, dpiy, screen):
self.setFocus()

self.isRDPRunning = True

self.full_screen_rect = (self.screen.geometry().x(), self.screen.geometry().y(), self.screen.geometry().x()+self.screen.geometry().width(), self.screen.geometry().y()+self.screen.geometry().height())
print("Full screen rect: ", self.full_screen_rect)

self.user32 = windll.user32
self.user32.SetProcessDPIAware() # optional, makes functions return real pixel numbers instead of scaled values
Expand All @@ -533,8 +536,6 @@ def __init__(self, dpix, dpiy, screen):
self.loop.start()
self.loop2.start()

self.full_screen_rect = (self.screen.geometry().x(), self.screen.geometry().y(), self.screen.geometry().x()+self.screen.geometry().width(), self.screen.geometry().y()+self.screen.geometry().height())
print("Full screen rect: ", self.full_screen_rect)

def refreshProcesses(self):
global isRDPRunning
Expand All @@ -549,7 +550,10 @@ def theresFullScreenWin(self, clockOnFirstMon):
fullscreen = False

def absoluteValuesAreEqual(a, b):
return (a[0]) == (b[0]) and (a[1]) == (b[1]) and (a[2]) == (b[2]) and (a[3]) == (b[3])
try:
return (a[0]) == (b[0]) and (a[1]) == (b[1]) and (a[2]) == (b[2]) and (a[3]) == (b[3])
except Exception as e:
print(e)

def winEnumHandler( hwnd, ctx ):
nonlocal fullscreen
Expand Down

0 comments on commit e395b01

Please sign in to comment.