Commit Graph
212 Commits
Author SHA1 Message Date
ReenigneArcher ff76d0ec99 Autodiscover WAYLAND_DISPLAY from XDG_RUNTIME_DIR
Add automatic discovery of a Wayland display socket when WAYLAND_DISPLAY is not set. Introduce discover_wayland_display_name() to scan XDG_RUNTIME_DIR for wayland-* entries (preferring wayland-0) and try_autodiscover_wayland_display() to export the found name via qputenv. Call the autodiscovery at tray initialization and emit a log message on success. Also include QStringList header required for the new code.
2026-03-28 23:22:55 -04:00
ReenigneArcher 3e57b845fd Force minimal QPA when no display endpoint
Add detection for reachable Wayland/X11 endpoints and fall back to the minimal QPA if none are present. Introduce QDir include and helper functions has_wayland_display_endpoint(), has_x11_display_endpoint(), and should_force_headless_qpa_fallback() to check WAYLAND_DISPLAY and DISPLAY (including XDG_RUNTIME_DIR sockets and /tmp/.X11-unix/X<n> sockets, as well as remote/TCP displays). If QT_QPA_PLATFORM is unset and no local display endpoints are found, set QT_QPA_PLATFORM=minimal before creating QApplication and emit a log via g_log_cb. This prevents trying to use GUI QPAs when no local display is reachable.
2026-03-28 23:22:55 -04:00
ReenigneArcher bf002e200e fix(linux): reset notifications during tray tray destruction 2026-03-28 23:22:55 -04:00
ReenigneArcher 0e634d5186 Wrap installs in TRAY_IS_TOP_LEVEL check
Only perform install steps when the project is top-level by wrapping install commands in if(TRAY_IS_TOP_LEVEL). Also normalize to lowercase install() and remove the duplicated target name (was INSTALL(TARGETS tray tray ...)). This prevents unintended installs when the project is used as a subdirectory while preserving header and icon installations.
2026-03-28 23:22:55 -04:00
ReenigneArcher e8bc13af7b test: improve linux test coverage 2026-03-28 23:22:55 -04:00
ReenigneArcher 144dad5123 style: sonar fixes 2026-03-28 23:22:54 -04:00
ReenigneArcher 214ea00120 Fix tray callback issues 2026-03-28 23:22:54 -04:00
ReenigneArcher 437250060b Add tray_set_app_info and Qt thread fixes
Add a new API tray_set_app_info to provide application metadata (name, display name, desktop file) used by the Linux/Qt backend and add no-op stubs for macOS and Windows. Improve Qt integration on Linux: add run_on_qt_thread helper, make g_exit_pending atomic, ensure all Qt GUI and teardown operations run on the Qt thread, and handle external event loops safely. Update notification/D-Bus handling and move tray updates, menu popup and simulated notification clicks onto the Qt thread to avoid cross-thread warnings. Also remove the QUIET flag from find_package(Qt6) in CMake and add necessary includes (atomic, utility, QThread).
2026-03-28 23:22:54 -04:00
ReenigneArcher 21f70b5d74 Refactor CMake for subproject and icons
Make CMakeLists usable as a subproject: detect top-level build (TRAY_IS_TOP_LEVEL) and gate BUILD_DOCS/BUILD_TESTS/BUILD_EXAMPLE on it. Don't override parent CMAKE_MODULE_PATH; append module path relative to current source dir. Centralize icon paths into TRAY_ICON_* variables, add tray_copy_default_icons() to copy icons at post-build, and install icons/headers. Use target_include_directories and expose compile definitions publicly for the library. Adjust Qt/Qt-version caching and other target properties.

Update tests/CMakeLists.txt to use CMAKE_CURRENT_SOURCE_DIR paths, reference the googletest directory relatively, force shared CRT on Windows earlier, link the test target against tray::tray, add icon copying for the test binary, and register the test with add_test.
2026-03-28 23:22:54 -04:00
ReenigneArcher a1f0a56d66 Use QGuiApplication for applicationDisplayName
Replace QCoreApplication::applicationDisplayName and setApplicationDisplayName with QGuiApplication equivalents in src/tray_linux.cpp. This ensures the GUI-specific API is used when initializing the tray's display name (from tooltip or default), avoiding misuse of QCoreApplication for GUI-only display name operations.
2026-03-28 23:22:54 -04:00
ReenigneArcher e79887d0f0 CI: add Qt5/Qt6 matrix and conditional deps
Add a matrix dimension for Qt version and run builds for both Qt5 and Qt6 on Ubuntu. The build job name now includes the Qt version, and qt_version is set per matrix entry. Linux dependency installation is made conditional on QT_VERSION (installing Qt5 or Qt6 packages accordingly) and QT_VERSION is exported into the job environment. Split CMake configure and ninja build into separate steps, make test environment/platformtheme conditional, and append Qt version to artifact names and codecov flags. Update README to document Qt5 and Qt6 package installation commands for supported distros.
2026-03-28 23:22:54 -04:00
ReenigneArcher edd9008c40 Add SVG support and improve Linux tray behavior
Add SVG tray icon support and make Linux tray handling more robust:

- CMake: include icons/*.svg, link Qt Svg (Qt5/Qt6), and copy icon.svg to build dir.
- Add new icons/icon.svg asset.
- src/tray_linux.cpp: improve Wayland detection, calculate menu position with preferred position, derive screen anchor, retry popup logic, robust icon resolution (file, pixmap, themed), set application/desktop names, and fallback standard icon.
- tests/unit/test_tray.cpp: ensure test icons are copied into the test binary directory, add TestTrayIconSvgFile unit test.

These changes fix issues with blank tray icons (Qt/SNI) and unreliable menu placement on Wayland, and add SVG icon support across platforms.
2026-03-28 23:22:53 -04:00
ReenigneArcher cac14ab20f Remove FindAPPINDICATOR and FindLibNotify
Delete legacy CMake find modules for AppIndicator and LibNotify
2026-03-28 23:22:53 -04:00
ReenigneArcher e9363c6572 Fix tray menu focus and icon loading on Linux
Replace QApplication::setActiveWindow with menu->activateWindow() to give the menu X11 focus before popup() and clarify the comment. Include QPixmap and change icon resolution logic: when the icon string refers to an existing file, load a QPixmap and add it to a QIcon immediately (avoiding QIcon's lazy loading that leaves availableSizes() empty and can produce a blank tray icon with Qt6 SNI). Fall back to QIcon::fromTheme() when the file doesn't exist. Keep guarding against setting null icons.
2026-03-28 23:22:53 -04:00
ReenigneArcher 25d0cf43da Improve tray menu positioning and icon handling
Detect Wayland sessions and improve context-menu placement by prioritizing tray icon geometry, then using QCursor on Xorg, and falling back to a screen-geometry heuristic on Wayland (inferring panel edge from full vs available geometry). Defer showing the menu with QTimer::singleShot(0) and call QApplication::setActiveWindow before popup() so pointer grabs and XGrabPointer behavior work reliably; avoid showing the menu if it's already visible. Also avoid clearing the tray icon by only setting it when the resolved QIcon is valid, preventing spurious "No Icon set" warnings.
2026-03-28 23:22:53 -04:00
ReenigneArcher 7f3e3bd81a Add tray log callback and menu positioning fixes
Expose tray_set_log_callback in the public API and implement it on Linux to forward Qt diagnostic messages to a user-provided callback (NULL restores default behavior). Add a Qt message handler and global callback state, and route qInstallMessageHandler accordingly; provide no-op stubs on macOS and Windows since Qt logging is not used there. Improve context-menu positioning by calculating a sensible popup point from the tray icon geometry (falling back to cursor position) and use it when showing menus. Defer D-Bus ActionInvoked connection via QTimer::singleShot to avoid QSocketNotifier warnings when the tray runs in a std::thread, and add a few related include adjustments and minor activation handling cleanup.
2026-03-28 23:22:53 -04:00
ReenigneArcher 39992ed86e Simulate notification clicks and D-Bus handler
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.
2026-03-28 23:22:53 -04:00
ReenigneArcher e969048eec fix(linux): support themed icons 2026-03-28 23:22:52 -04:00
ReenigneArcher 0fccbce477 fix(linux): notification icon 2026-03-28 23:22:52 -04:00
ReenigneArcher 290e3a592c fix(linux): tray destruction 2026-03-28 23:22:52 -04:00
ReenigneArcher 10556135f7 style: sonar fixes 2026-03-28 23:22:52 -04:00
ReenigneArcher b409a01dec fix(linux): migrate to qt tray 2026-03-28 23:22:52 -04:00
dependabot[bot] 6fa152fcec build(deps): bump LizardByte/actions from 2026.227.200013 to 2026.328.161128 in the lizardbyte-actions group across 1 directory (#109)
build(deps): bump LizardByte/actions

Bumps the lizardbyte-actions group with 1 update in the / directory: [LizardByte/actions](https://github.com/lizardbyte/actions).


Updates `LizardByte/actions` from 2026.227.200013 to 2026.328.161128
- [Release notes](https://github.com/lizardbyte/actions/releases)
- [Commits](https://github.com/lizardbyte/actions/compare/70bb8d394d1c92f6113aeec6ae9cc959a5763d15...0affa4f7bcb27562658960eee840eff8ff844578)

---
updated-dependencies:
- dependency-name: LizardByte/actions
  dependency-version: 2026.328.161128
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: lizardbyte-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-28 21:17:02 -04:00
LizardByte-bot 4fcdc24392 chore: update global workflows (#108) 2026-03-28 14:42:18 -04:00
dependabot[bot] d9c2bfbd1a build(deps): bump codecov/codecov-action from 5.5.3 to 6.0.0 (#106)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5.5.3 to 6.0.0.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/1af58845a975a7985b0beb0cbe6fbbb71a41dbad...57e3a136b779b570ffcdbf80b3bdc90e7fab3de2)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-version: 6.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-28 14:35:42 -04:00
David Lane b6e9827035 ci: publish screenshots enhancements (#107) 2026-03-27 09:11:53 -04:00
David Lane f04a48b46c ci(publish-screenshots): update existing PR comment (#105) 2026-03-26 10:00:17 -04:00
dependabot[bot] 98a0a394f1 build(deps): bump actions/download-artifact from 7.0.0 to 8.0.1 in the github-actions group across 1 directory (#102)
build(deps): bump actions/download-artifact

Bumps the github-actions group with 1 update in the / directory: [actions/download-artifact](https://github.com/actions/download-artifact).


Updates `actions/download-artifact` from 7.0.0 to 8.0.1
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/37930b1c2abaa49bbe596cd826c3c89aef350131...3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: 8.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-23 18:46:33 -04:00
dependabot[bot] c9b58377c4 build(deps): bump msys2/setup-msys2 from 2.30.0 to 2.31.0 (#103)
Bumps [msys2/setup-msys2](https://github.com/msys2/setup-msys2) from 2.30.0 to 2.31.0.
- [Release notes](https://github.com/msys2/setup-msys2/releases)
- [Changelog](https://github.com/msys2/setup-msys2/blob/main/CHANGELOG.md)
- [Commits](https://github.com/msys2/setup-msys2/compare/4f806de0a5a7294ffabaff804b38a9b435a73bda...cafece8e6baf9247cf9b1bf95097b0b983cc558d)

---
updated-dependencies:
- dependency-name: msys2/setup-msys2
  dependency-version: 2.31.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-23 18:46:17 -04:00
David Lane 563dee475f ci: create releases (#101) v2026.323.31823 2026-03-22 23:18:23 -04:00
David Lane c7f04966c0 fix(Windows): Handle thread WM_QUIT and fix message dispatch (#100) 2026-03-22 22:57:16 -04:00
David LaneandThomas Van Laere 7936cb35ae test: add screenshots (#86)
Co-authored-by: Thomas Van Laere <4990509+thomvanl@users.noreply.github.com>
2026-03-22 22:22:24 -04:00
dependabot[bot] 7ce2adc9b7 build(deps): bump third-party/doxyconfig from a9f0c38 to 334ad6a (#99)
Bumps [third-party/doxyconfig](https://github.com/LizardByte/doxyconfig) from `a9f0c38` to `334ad6a`.
- [Release notes](https://github.com/LizardByte/doxyconfig/releases)
- [Commits](https://github.com/LizardByte/doxyconfig/compare/a9f0c38766e53d29f1141098db237e51ba3d64d8...334ad6a7421663be9edbaf4897c33b524642ca70)

---
updated-dependencies:
- dependency-name: third-party/doxyconfig
  dependency-version: 334ad6a7421663be9edbaf4897c33b524642ca70
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-22 11:40:19 -04:00
dependabot[bot] 58aa7112a6 build(deps): bump codecov/codecov-action from 5.5.2 to 5.5.3 (#98)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5.5.2 to 5.5.3.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/671740ac38dd9b0130fbe1cec585b89eea48d3de...1af58845a975a7985b0beb0cbe6fbbb71a41dbad)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-version: 5.5.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-19 08:19:10 -04:00
dependabot[bot] 0d64faa244 build(deps): bump third-party/doxyconfig from ba47416 to a9f0c38 (#97)
Bumps [third-party/doxyconfig](https://github.com/LizardByte/doxyconfig) from `ba47416` to `a9f0c38`.
- [Commits](https://github.com/LizardByte/doxyconfig/compare/ba47416c88a7f5661fa1ed24b7300ef62185e877...a9f0c38766e53d29f1141098db237e51ba3d64d8)

---
updated-dependencies:
- dependency-name: third-party/doxyconfig
  dependency-version: a9f0c38766e53d29f1141098db237e51ba3d64d8
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-15 14:08:49 -04:00
LizardByte-bot 8adca753c5 chore: update global workflows (#95) 2026-03-03 08:40:24 -05:00
dependabot[bot] 23ec5d93ec build(deps): bump third-party/doxyconfig from 1188ef2 to ba47416 (#94)
Bumps [third-party/doxyconfig](https://github.com/LizardByte/doxyconfig) from `1188ef2` to `ba47416`.
- [Commits](https://github.com/LizardByte/doxyconfig/compare/1188ef2b96efb3e003a591ee01714339c2d9161c...ba47416c88a7f5661fa1ed24b7300ef62185e877)

---
updated-dependencies:
- dependency-name: third-party/doxyconfig
  dependency-version: ba47416c88a7f5661fa1ed24b7300ef62185e877
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-26 08:56:42 -05:00
LizardByte-bot b7275020e5 chore: update global workflows (#90) 2026-02-14 15:28:57 -05:00
LizardByte-bot fae9bc519f chore: update GitHub Actions to use commit hashes (#89) 2026-02-13 19:37:28 -05:00
David Lane 3a0d9ced45 ci: refactor workflow permissions and triggers (#88) 2026-02-13 18:50:04 -05:00
David Lane 09c5784b9b ci: migrate codecov/test-results-action to codecov/codecov-action (#85) 2025-12-24 21:31:05 -05:00
LizardByte-bot 825a5d99f9 chore: update global workflows (#83) 2025-12-24 20:53:09 -05:00
dependabot[bot] a3236106a5 build(deps): bump msys2/setup-msys2 from 2.29.0 to 2.30.0 (#81)
Bumps [msys2/setup-msys2](https://github.com/msys2/setup-msys2) from 2.29.0 to 2.30.0.
- [Release notes](https://github.com/msys2/setup-msys2/releases)
- [Changelog](https://github.com/msys2/setup-msys2/blob/main/CHANGELOG.md)
- [Commits](https://github.com/msys2/setup-msys2/compare/fb197b72ce45fb24f17bf3f807a388985654d1f2...4f806de0a5a7294ffabaff804b38a9b435a73bda)

---
updated-dependencies:
- dependency-name: msys2/setup-msys2
  dependency-version: 2.30.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-14 21:51:25 -05:00
dependabot[bot] 1eb72acc82 build(deps): bump codecov/codecov-action from 5.5.1 to 5.5.2 (#80)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5.5.1 to 5.5.2.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/5a1091511ad55cbe89839c7260b706298ca349f7...671740ac38dd9b0130fbe1cec585b89eea48d3de)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-version: 5.5.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-10 09:29:22 -05:00
LizardByte-bot 64cd64d8ba chore: update global workflows (#78) 2025-12-09 08:52:55 -05:00
David Lane 46050952c0 ci: Pin GitHub Actions to specific commit SHAs (#77) 2025-11-29 15:31:53 -05:00
Cameron Gutman 4caf0d0868 fix: make tray_exit() thread-safe (#76) 2025-11-28 19:22:07 -05:00
Yundi339 d43f4c24d6 fix(windows): incorrect UTF8/GBK string encoding handling (#74) 2025-11-24 19:08:20 -05:00
dependabot[bot] 4d1dafc551 build(deps): bump actions/checkout from 5 to 6 in the github-actions group (#75)
build(deps): bump actions/checkout in the github-actions group

Bumps the github-actions group with 1 update: [actions/checkout](https://github.com/actions/checkout).


Updates `actions/checkout` from 5 to 6
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-22 14:30:44 -05:00
LizardByte-bot 5aa60f8638 chore: update global workflows (#68) 2025-09-21 20:42:50 -04:00