Skip to content

Commit 81b5ef6

Browse files
fix(trayicon): reduce wait timeout from 30s to 10s
10 seconds is sufficient for KDE Plasma to load the system tray. Feedback from @ErikBjare.
1 parent f071fe0 commit 81b5ef6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

aw_qt/trayicon.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,20 +242,20 @@ def run(manager: Manager, testing: bool = False) -> Any:
242242
# root widget
243243
widget = QWidget()
244244

245-
# Wait for system tray to become available (up to 30 s).
245+
# Wait for system tray to become available (up to 10 s).
246246
# On some desktop environments (e.g. KDE Plasma), autostart programs
247247
# launch before the panel/system tray is loaded. Qt docs note that
248248
# "if the system tray is currently unavailable but becomes available
249249
# later, QSystemTrayIcon will automatically add an entry."
250250
# See: https://github.com/ActivityWatch/aw-qt/issues/97
251251
if not QSystemTrayIcon.isSystemTrayAvailable():
252-
logger.info("System tray not yet available, waiting up to 30 s...")
253-
for i in range(30):
252+
logger.info("System tray not yet available, waiting up to 10 s...")
253+
for i in range(10):
254254
time.sleep(1)
255255
# Process events so Qt can detect tray availability changes
256256
app.processEvents()
257257
if QSystemTrayIcon.isSystemTrayAvailable():
258-
logger.info(f"System tray became available after {i + 1} s")
258+
logger.info(f"System tray became available after {i + 1}s")
259259
break
260260
else:
261261
QMessageBox.critical(

0 commit comments

Comments
 (0)