Skip to content

Commit

Permalink
improvements on how the clock nahdles taskbar detection
Browse files Browse the repository at this point in the history
  • Loading branch information
marticliment committed Oct 24, 2023
1 parent decf6c4 commit d7c61be
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 16 deletions.
4 changes: 2 additions & 2 deletions ElevenClock.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "ElevenClock"
#define MyAppVersion "4.3.1"
#define MyAppVersion "4.3.2"
#define MyAppPublisher "Martí Climent"
#define MyAppURL "https://marticliment.com/elevenclock"
#define MyAppExeName "ElevenClock.exe"
Expand All @@ -19,7 +19,7 @@ AppPublisher="Martí Climent"
AppPublisherURL="https://marticliment.com/"
AppSupportURL="https://marticliment.com/#contact"
AppUpdatesURL="https://github.com/marticliment/ElevenClock/releases"
VersionInfoVersion=4.3.1.0
VersionInfoVersion=4.3.2.0
DefaultDirName={autopf}\ElevenClock
DisableDirPage=yes
ChangesAssociations=yes
Expand Down
4 changes: 2 additions & 2 deletions elevenclock-version-info
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ StringFileInfo(
[
StringStruct(u'CompanyName', u'Martí Climent'),
StringStruct(u'FileDescription', u'ElevenClock'),
StringStruct(u'FileVersion', u'4.3.1'),
StringStruct(u'ProductVersion', u'4.3.1'),
StringStruct(u'FileVersion', u'4.3.2'),
StringStruct(u'ProductVersion', u'4.3.2'),
StringStruct(u'InternalName', u'ElevenClock'),
StringStruct(u'LegalCopyright', u'Martí Climent'),
StringStruct(u'OriginalFilename', u'elevenclock.exe'),
Expand Down
26 changes: 17 additions & 9 deletions elevenclock/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1158,6 +1158,8 @@ def mainClockLoop(self):

print(f"🔵 Show/hide loop started with parameters: HideonFS:{ENABLE_HIDE_ON_FULLSCREEN}, NotHideOnTB:{DISABLE_HIDE_WITH_TASKBAR}, DisableNotifications:{SHOW_NOTIFICATIONS}")

ClockShownByTaskbarShow: bool = False

while True:
self.AWindowIsInFullScreen = self.TheresAWindowInFullscreen()
HideClock = False
Expand All @@ -1170,21 +1172,27 @@ def mainClockLoop(self):
HideClock = self.AWindowIsInFullScreen

if not HideClock and not DISABLE_HIDE_WITH_TASKBAR and self.TASKBAR_DOES_AUTOHIDE:

mousePos = getMousePos()
if (mousePos.y() + 1 == self.screenGeometry.y() + self.screenGeometry.height()) and self.screenGeometry.x() < mousePos.x() and self.screenGeometry.x()+self.screenGeometry.width() > mousePos.x():
if (mousePos.y() + 1 == self.screenGeometry.y() + self.screenGeometry.height()) and mousePos.x() > self.screenGeometry.x() and mousePos.x() < (self.screenGeometry.x() + self.screenGeometry.width()):
if self.isHidden():
time.sleep(0.22)
time.sleep(0.28)
HideClock = False
elif (mousePos.y() <= self.screenGeometry.y()+self.screenGeometry.height()-self.preferedHeight):
if globals.trayIcon != None:
ClockShownByTaskbarShow = True
elif mousePos.y() <= (self.screenGeometry.y() + self.screenGeometry.height() - self.preferedHeight - 10) and ClockShownByTaskbarShow:
if globals.trayIcon is not None:
menu = globals.trayIcon.contextMenu()
if menu.isVisible():
HideClock = False
else:
HideClock = True
HideClock = not menu.isVisible()
ClockShownByTaskbarShow = menu.isVisible()
else:
HideClock = True

ClockShownByTaskbarShow = False
else:
if not ClockShownByTaskbarShow:
HideClock = True
else:
HideClock = False

if HideClock:
self.hideSignal.emit()
BackgroundUpdatesCounter = 0
Expand Down
6 changes: 3 additions & 3 deletions elevenclock/versions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
version = 4.31
versionName = "4.3.1"
versionISS = "4.3.1.0"
version = 4.32
versionName = "4.3.2"
versionISS = "4.3.2.0"

0 comments on commit d7c61be

Please sign in to comment.