Skip to content

Commit 8eadfa1

Browse files
committed
fix(taskbar): prevent closing of pinned-only buttons
- Added a check to avoid closing buttons that represent pinned applications when their hwnd is negative. - This ensures that pinned apps that are not currently running remain unaffected by close actions.
1 parent c640da4 commit 8eadfa1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/core/widgets/yasb/taskbar.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1417,6 +1417,10 @@ def _on_close_app(self) -> None:
14171417
logging.warning("No hwnd found for widget.")
14181418
return
14191419

1420+
# Don't close pinned-only buttons (negative hwnd = placeholder for pinned apps not running)
1421+
if hwnd < 0:
1422+
return
1423+
14201424
# Check if the window is valid before attempting to close it
14211425
if win32gui.IsWindow(hwnd):
14221426
close_application(hwnd)

0 commit comments

Comments
 (0)