Skip to content

fix(linux): honor tray primary action in KDE - #443

Open
BiFangKNT wants to merge 1 commit into
NucleusFramework:masterfrom
BiFangKNT:fix/linux-tray-primary-action
Open

BiFangKNT wants to merge 1 commit into
NucleusFramework:masterfrom
BiFangKNT:fix/linux-tray-primary-action

Conversation

@BiFangKNT

Copy link
Copy Markdown

On KDE Plasma, a tray with a primary action still opens its menu on left click because the Linux SNI backend always advertises ItemIsMenu=true. This change derives the property from primary action availability, so left click invokes the action when present and opens the menu otherwise. Right-click menu behavior is preserved.

The Kotlin manager now synchronizes callback presence when the action is added or removed. These transitions emit both PropertiesChanged and NewTitle, which lets Plasma refresh its cached ItemIsMenu. Native callback access and JNI references are protected while callbacks are updated.

Validation:

  • Native D-Bus regression tests cover initial state, dynamic transitions, Plasma-style host cache refresh, activation, and context menus. The cache regression fails without the added SNI refresh signal.
  • Kotlin/JNI integration test covers adding, replacing, and removing the primary action.
  • Existing 200,000-round concurrency, pixmap, and JNI UTF-8 tests passed; ktlintCheck passed.
  • Linux x64 native library and JVM JAR built successfully; manually verified on Fedora KDE.

The new regression tests are included in CI.

Derive ItemIsMenu from primary action availability and synchronize
callback presence when the action changes. Emit NewTitle alongside
PropertiesChanged so Plasma refreshes its cached activation mode.

Protect click callback access across native and JNI threads. Add
D-Bus regression coverage for activation, host cache refresh, and
context menus, and run it in CI.

Verified with automated tests and manual testing on Fedora KDE.

This branch has not been deployed

No deployments
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