mirror of
https://github.com/LizardByte/tray.git
synced 2026-12-06 15:12:48 +09:00
Add support for simulating notification clicks and routing D-Bus notification actions to callbacks. - Export tray_simulate_notification_click() in tray.h and provide platform implementations: no-op stubs for macOS and Windows, and a working simulator for Linux. - Introduce TrayNotificationHandler (src/tray_notification_handler.h) to handle org.freedesktop.Notifications ActionInvoked signals and invoke the stored callback when the "default" action is triggered. - Integrate the handler into the Linux tray: create/connect a single handler per QApplication, store callback and notification ID before calling Notify, set up a fallback that connects QSystemTrayIcon::messageClicked when D-Bus is unavailable, and clean up/disconnect the handler on app destroy. - Also connect QSystemTrayIcon::activated to popup the context menu on left/middle clicks (fixes missing menu on left-click). - Add unit tests verifying left-click menu popup and that notification callbacks fire when simulated (tests call tray_simulate_notification_click()). These changes ensure notification clicks are handled consistently for D-Bus-dispatched notifications and add a test hook for exercising the click behavior.