Skip to content

Commit 2ed852e

Browse files
fix(trayicon): re-apply tooltip after show() to fix empty tooltip on Windows 11 (#115)
On Windows 11, QSystemTrayIcon tooltips set before show() may not register with the system tray backend, resulting in an empty tooltip on hover. Re-applying the tooltip text after the icon is visible ensures the platform picks it up. Fixes #112
1 parent 6ab7e3f commit 2ed852e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

aw_qt/trayicon.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,12 @@ def run(manager: Manager, testing: bool = False) -> Any:
259259
trayIcon = TrayIcon(manager, icon, widget, testing=testing)
260260
trayIcon.show()
261261

262+
# Re-apply tooltip after show() to ensure it registers with the
263+
# platform's system tray backend. On Windows 11 the tooltip can
264+
# appear empty when it is only set before the icon is visible.
265+
# See: https://github.com/ActivityWatch/aw-qt/issues/112
266+
trayIcon.setToolTip(trayIcon.toolTip())
267+
262268
QApplication.setQuitOnLastWindowClosed(False)
263269

264270
logger.info("Initialized aw-qt and trayicon successfully")

0 commit comments

Comments
 (0)