Skip to content

test: gate tray test hooks behind build flag - #184

Merged
ReenigneArcher merged 3 commits into
masterfrom
test/fix-tray-icon-position
Sep 6, 2026
Merged

test: gate tray test hooks behind build flag#184
ReenigneArcher merged 3 commits into
masterfrom
test/fix-tray-icon-position

Conversation

@ReenigneArcher

@ReenigneArcher ReenigneArcher commented Sep 6, 2026

Copy link
Copy Markdown
Member

Description

Wraps mouse-position test helpers and related Qt/state code in TRAY_ENABLE_TEST_HOOKS so test-only APIs are excluded from normal builds. CMake now defines this flag for top-level test builds and for the test target, keeping production/library consumers free of test hooks while preserving test functionality.

Also fixes mouse position for Linux tests (using plasma in CI).

Screenshot

Issues Fixed or Closed

Roadmap Issues

Type of Change

  • feat: New feature (non-breaking change which adds functionality)
  • fix: Bug fix (non-breaking change which fixes an issue)
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc.)
  • refactor: Code change that neither fixes a bug nor adds a feature
  • perf: Code change that improves performance
  • test: Adding missing tests or correcting existing tests
  • build: Changes that affect the build system or external dependencies
  • ci: Changes to CI configuration files and scripts
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit
  • BREAKING CHANGE: Introduces a breaking change (can be combined with any type above)

Checklist

  • Code follows the style guidelines of this project
  • Code has been self-reviewed
  • Code has been commented, particularly in hard-to-understand areas
  • Code docstring/documentation-blocks for new or existing methods/components have been added or updated
  • Unit tests have been added or updated for any new or modified functionality

AI Usage

See our AI usage policy.

  • None: No AI tools were used in creating this PR
  • Light: AI provided minor assistance (formatting, simple suggestions)
  • Moderate: AI helped with code generation or debugging specific parts
  • Heavy: AI generated most or all of the code changes

Update the Linux-specific fallback menu anchor when only a bottom inset is detected. Instead of using the far-right edge, position the tray point at roughly three-quarters of the screen width to better match KDE Plasma’s default bottom panel layout, where the rightmost control is often “Peek at Desktop” rather than a tray icon.
@codecov

codecov Bot commented Sep 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.62%. Comparing base (9f6672c) to head (c5df854).
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #184      +/-   ##
==========================================
- Coverage   61.74%   61.62%   -0.12%     
==========================================
  Files           5        5              
  Lines         515      516       +1     
  Branches      194      194              
==========================================
  Hits          318      318              
- Misses        127      128       +1     
  Partials       70       70              
Flag Coverage Δ
Linux-qt5 58.73% <100.00%> (ø)
Linux-qt6 58.22% <100.00%> (ø)
Windows-qt6 56.07% <ø> (ø)
macOS-qt6 55.53% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/QtTrayMenu.cpp 67.35% <100.00%> (-0.24%) ⬇️
src/QtTrayMenu.h 100.00% <ø> (ø)
src/tray_qt.cpp 64.39% <ø> (ø)

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9f6672c...c5df854. Read the comment docs.

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Last Updated 2026-09-06 15:17:09 UTC
Source Run CI Run #787
Commit c5df854df9eba5e693910877e9281a35ba59dca5

Screenshot Comparison

PR #184 screenshots vs screenshots baseline.

Matrix: Linux-qt5

Image Baseline PR
tray_icon_ico.png
tray_icon_initial.png
tray_icon_png.png
tray_icon_svg.png
tray_icon_themed.png
tray_icon_update_ico.png
tray_icon_update_png.png
tray_icon_update_svg.png
tray_icon_update_themed.png
tray_menu_checkbox_checked.png
tray_menu_checkbox_unchecked.png
tray_menu_left_click.png
tray_menu_shown.png
tray_notification_ico_icon.png
tray_notification_png_icon.png
tray_notification_svg_icon.png
tray_notification_themed_icon.png
tray_tooltip_hover.png

Matrix: Linux-qt6

Image Baseline PR
tray_icon_ico.png
tray_icon_initial.png
tray_icon_png.png
tray_icon_svg.png
tray_icon_themed.png
tray_icon_update_ico.png
tray_icon_update_png.png
tray_icon_update_svg.png
tray_icon_update_themed.png
tray_menu_checkbox_checked.png
tray_menu_checkbox_unchecked.png
tray_menu_left_click.png
tray_menu_shown.png
tray_notification_ico_icon.png
tray_notification_png_icon.png
tray_notification_svg_icon.png
tray_notification_themed_icon.png
tray_tooltip_hover.png

Matrix: Windows-qt6

Image Baseline PR
tray_icon_ico.png
tray_icon_initial.png
tray_icon_png.png
tray_icon_svg.png
tray_icon_themed.png
tray_icon_update_ico.png
tray_icon_update_png.png
tray_icon_update_svg.png
tray_icon_update_themed.png
tray_menu_checkbox_checked.png
tray_menu_checkbox_unchecked.png
tray_menu_left_click.png
tray_menu_shown.png
tray_notification_ico_icon.png
tray_notification_png_icon.png
tray_notification_svg_icon.png
tray_notification_themed_icon.png
tray_tooltip_hover.png

Matrix: macOS-qt6

Image Baseline PR
tray_icon_ico.png
tray_icon_initial.png
tray_icon_png.png
tray_icon_svg.png
tray_icon_themed.png
tray_icon_update_ico.png
tray_icon_update_png.png
tray_icon_update_svg.png
tray_icon_update_themed.png
tray_menu_checkbox_checked.png
tray_menu_checkbox_unchecked.png
tray_menu_left_click.png
tray_menu_shown.png
tray_notification_ico_icon.png
tray_notification_png_icon.png
tray_notification_svg_icon.png
tray_notification_themed_icon.png
tray_tooltip_hover.png

Wraps mouse-position test helpers and related Qt/state code in `TRAY_ENABLE_TEST_HOOKS` so test-only APIs are excluded from normal builds. CMake now defines this flag for top-level test builds and for the test target, keeping production/library consumers free of test hooks while preserving test functionality.
@ReenigneArcher
ReenigneArcher force-pushed the test/fix-tray-icon-position branch from f04464d to 0ca2579 Compare September 6, 2026 14:44
@ReenigneArcher ReenigneArcher changed the title test: adjust Linux tray fallback position on Plasma test: gate tray test hooks behind build flag Sep 6, 2026
Extract tooltip wait logic into a dedicated `WaitForTooltipReady()` helper and use it in `TestTooltipDisplayOnHover`. This centralizes the asynchronous shell-tooltip delay handling and improves test readability and consistency.
@ReenigneArcher
ReenigneArcher marked this pull request as ready for review September 6, 2026 15:01
@sonarqubecloud

sonarqubecloud Bot commented Sep 6, 2026

Copy link
Copy Markdown

@ReenigneArcher
ReenigneArcher merged commit dbacfbe into master Sep 6, 2026
24 checks passed
@ReenigneArcher
ReenigneArcher deleted the test/fix-tray-icon-position branch September 6, 2026 15:18
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.

1 participant