Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 14, 2025

Description

macOS 15 (Sequoia) changed NSStatusItem tooltip behavior—tooltips must now be set on NSStatusItem.button instead of the NSStatusItem itself. Qt's QSystemTrayIcon::setToolTip() doesn't handle this, causing tooltips to not appear.

Changes

  • src/gui/systray.h: Override setToolTip() to dispatch to platform-specific implementation
  • src/gui/systray.cpp: Route macOS calls to native handler, other platforms use Qt directly
  • src/gui/systray_mac_common.mm: Implement workaround using Objective-C runtime introspection
    • Access Qt's internal QCocoaSystemTrayIcon via class_copyIvarList/object_getIvar
    • Set tooltip on NSStatusItem.button.toolTip directly
    • Guard with @available(macOS 15.0, *) check
    • Fallback gracefully if introspection fails
// In setTrayIconToolTip():
trayIcon->QSystemTrayIcon::setToolTip(toolTip);  // Call base for compatibility

if (@available(macOS 15.0, *)) {
    // Find NSStatusItem via runtime introspection of Qt's internal object
    NSStatusItem *statusItem = /* ... */;
    statusItem.button.toolTip = toolTip.toNSString();  // Required for macOS 15+
}

Backward compatible with older macOS versions. No impact on Linux/Windows.

Testing

Requires macOS 15+ hardware. See MACOS_TOOLTIP_FIX.md for test cases.

Original prompt

the tray icon in macos always had a hover message to show the sync status of the accounts.
in the current release it is not working anymore. nothing is shown.

This is the case since macOS 26


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits November 14, 2025 08:07
Implement native NSStatusItem.button tooltip setting to fix hover message
not showing on macOS 15 (Sequoia) and later versions.

Co-authored-by: Rello <[email protected]>
Copilot AI changed the title [WIP] Fix hover message for sync status in macOS tray icon Fix tray icon tooltip not displaying on macOS 15+ (Sequoia) Nov 14, 2025
Copilot AI requested a review from Rello November 14, 2025 08:12
Copilot finished work on behalf of Rello November 14, 2025 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants