Skip to content

Commit 55c0e1a

Browse files
committed
v1.5.1
- Taskbar button fix when pinned
1 parent e94d9d4 commit 55c0e1a

2 files changed

Lines changed: 15 additions & 8 deletions

File tree

CHANGELOG.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
v1.5.1
2+
- Taskbar button fix when pinned
3+
14
v1.5.0
25
- Terminal signals now has an ESP UART and ESP JTAG mode: reset into app, reset into bootmode that sequences the RTS/DTR signals correctly (for each type)
36
- Show On all desktops is now optional, configurable in settings (off requires taskbar button)

monitor.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,18 @@ class icon, so push both explicitly."""
122122
_user32.SendMessageW(h, _WM_SETICON, _ICON_SMALL, small)
123123
_set_class_long(h, _GCLP_HICONSM, small)
124124

125-
# Give the process its own taskbar identity. Run via python.exe the button
126-
# otherwise inherits the interpreter's AppUserModelID (and its icon),
127-
# ignoring our per-window icon. Must happen before the first window appears.
128-
try:
129-
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(
130-
"com_monitor.widget")
131-
except Exception: # noqa: BLE001
132-
pass
125+
# Run via python.exe the taskbar button inherits the interpreter's
126+
# AppUserModelID (and its icon), ignoring our per-window icon — so give the
127+
# process its own identity. Skip this for the frozen .exe: there the exe is
128+
# already its own identity with an embedded icon, and an explicit AppID with
129+
# no relaunch/icon info would break the pinned-to-taskbar icon. Must happen
130+
# before the first window appears.
131+
if not getattr(sys, "frozen", False):
132+
try:
133+
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(
134+
"com_monitor.widget")
135+
except Exception: # noqa: BLE001
136+
pass
133137
else:
134138
def make_taskbar_window(hwnd):
135139
pass

0 commit comments

Comments
 (0)