Skip to content

fix(linux): clean GTK4 tray follow-ups - #4

Merged
OlympusLedgerOrg merged 9 commits into
gtk4-webkit6-tao-wryfrom
gtk4-webkit6-integration
Jul 8, 2026
Merged

fix(linux): clean GTK4 tray follow-ups#4
OlympusLedgerOrg merged 9 commits into
gtk4-webkit6-tao-wryfrom
gtk4-webkit6-integration

Conversation

@OlympusLedgerOrg

@OlympusLedgerOrg OlympusLedgerOrg commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • keep the GTK4 integration branch current with upstream dev
  • keep Tauri's tray path on tray-icon/linux-ksni
  • remove the stale vendored tray-icon lockfile that still recorded the old GTK3/appindicator/glib 0.18 standalone graph
  • document the KSNI backend separately from the legacy appindicator backend

Validation

  • cargo check -p tauri --features tray-icon --locked
  • cargo tree -p tauri --locked --target x86_64-unknown-linux-gnu --features tray-icon -e normal
  • recursive lockfile scan found no glib 0.18.5, gtk 0.18, or libappindicator entries in remaining lockfiles

This PR is for the fork only. The accidental upstream tauri-apps/tauri PR was closed and marked as opened by mistake.

Summary by CodeRabbit

  • Bug Fixes

    • Improved tray icon behavior and documentation for Linux/BSD, including updated guidance for the newer linux-ksni backend.
    • Tightened icon dimension handling to better avoid invalid image size issues.
    • Updated mobile and desktop runtime handling for safer platform-specific behavior.
  • Documentation

    • Clarified that menuOnLeftClick no longer works since v2.2 and pointed to the replacement setting.
    • Expanded tray icon setup notes and installation instructions for Linux distributions.
  • Chores

    • Updated dependency and security audit metadata.

Legend-Master and others added 6 commits July 7, 2026 22:06
* chore: run clippy on all platforms

* Only install dependencies for linux

* Use cross on Android

* mac clippy

* mobile clippy

* run on `macos-latest`

* duplicated cargo

* mac clippy suggestion take 2

* ios clippy

* Exclude tauri-cli and tauri-bundler on mobile

* Exclude `tauri-cli-node`

* just test api example on mobile

* Fix audit

* Android clippy

* Run the event handler in test
…pps#15677)

* chore(deps): serial_test 3.5.0 to deal with RUSTSEC advisory

* add change file
@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 95d18a65-62a3-4dee-8581-a46ca8f097f3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR bundles CI matrix updates for cross-platform Rust linting, GTK4/WebKitGTK6 supply-chain audit documentation and cargo-vet policy expansion, deprecation of TrayIconConfig.menuOnLeftClick, removal of unnecessary unsafe blocks on iOS/macOS, explicit lifetime parameters on Android JNI closures, desktop-only cfg gating, and tray-icon Linux backend documentation updates.

Changes

CI and Supply-Chain

Layer / File(s) Summary
Cross-platform clippy matrix
.github/workflows/lint-rust.yml
Rust lint job converted to a strategy matrix across Windows/Linux/macOS/iOS/Android targets with conditional dependency installs, cross tool setup, and target-scoped clippy invocation.
GTK4/WebKitGTK6 audit notes and cargo-vet policy
audits/GTK4_WebKit6_supply_chain_notes.md, supply-chain/config.toml
New audit document covers runtime dependency graph, example-only deps, Socket scanner triage, and cargo-vet status; config.toml adds audit-as-crates-io policy entries for several Tauri and ported crates.

Tray Icon Deprecation and Docs

Layer / File(s) Summary
menuOnLeftClick deprecation
crates/tauri-utils/src/config.rs, crates/tauri-cli/config.schema.json, crates/tauri-schema-generator/schemas/config.schema.json, crates/tauri/src/app.rs, crates/tauri/src/tray/mod.rs
Deprecation message updated to reference show_menu_on_left_click; removed call to deprecated menu_on_left_click in Builder::build; fixed intra-doc link.
tray-icon Linux backend documentation
ports/tray-icon/README.md, ports/tray-icon/src/lib.rs
Docs updated to describe linux-ksni (D-Bus/ksni) vs legacy gtk backend and revised package install commands for Arch/Debian.

Safety and Lifetime Cleanups

Layer / File(s) Summary
iOS/macOS unsafe removal
crates/tauri/src/app.rs, crates/tauri-runtime-wry/src/window/macos.rs
Removed unnecessary unsafe blocks around main-thread calls and NSWindow sheet operations.
JNI lifetime parameters and desktop cfg gating
crates/tauri-runtime-wry/src/lib.rs, crates/tauri/src/test/mock_runtime.rs, crates/tauri/src/lib.rs, crates/tauri-runtime-wry/src/window/mod.rs
Added explicit lifetimes to run_on_android_context closure bounds; gated UnsafeSend, run_main_thread, and MonitorExt import behind #[cfg(desktop)].
Android plugin cleanup
crates/tauri/src/plugin/mobile.rs
Removed unneeded borrows in env.new_string calls and dropped unused generic parameter from nested run helper.
Supporting refactors and fixes
crates/tauri-cli/src/helpers/pbxproj.rs, crates/tauri-bundler/Cargo.toml, ports/tao/src/platform_impl/linux/icon.rs, crates/tauri/src/webview/webview_window.rs, examples/api/src-tauri/src/lib.rs, .changes/change-pr-15677.md, crates/tauri-utils/Cargo.toml
Loop refactor in pbxproj parsing, glob dependency moved to unconditional deps, checked overflow handling for icon dimensions, doc example cleanup, example app event-matching/argument tweaks, and serial_test bumped to 3.5.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • OlympusLedgerOrg/tauri#3: Adds related GTK4/WebKitGTK6 supply-chain audit notes and extends the same supply-chain/config.toml cargo-vet policies for ported crates.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and broadly matches the Linux GTK4 tray maintenance and follow-up fixes in this PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch gtk4-webkit6-integration

Comment @coderabbitai help to get the list of available commands.

@OlympusLedgerOrg

Copy link
Copy Markdown
Owner Author

@CodeRabbit review please

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

@OlympusLedgerOrg: Sure, I'll review the changes now.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@OlympusLedgerOrg

Copy link
Copy Markdown
Owner Author

@CodeRabbit what do you think about socket?

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
rg -ni 'socket' --type toml -g '**/Cargo.toml' 2>/dev/null | head -50
rg -ni 'socket' -g '*.rs' 2>/dev/null | head -50
fd -i socket 2>/dev/null | head -20

Length of output: 412


@OlympusLedgerOrg: I searched the repository (Cargo manifests, .rs files, and filenames) and found no references to "socket" anywhere in this codebase or PR. Could you clarify what you're asking about? For example:

  • Are you asking about switching the tray/IPC mechanism to use Unix domain sockets instead of D-Bus (which KSNI relies on for tray communication)?
  • Is this about a specific crate (e.g., socket2, tokio::net::UnixListener) you're considering adding as a dependency?
  • Or is this unrelated to the code and more of a general architecture question?

Once I know the specific context, I can give a more useful opinion.

(-.-)?

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
crates/tauri/src/app.rs (1)

680-687: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Don’t ignore run_on_main_thread failures here.
If dispatch fails, nothing sends on tx and rx.recv() can block forever. Return false immediately before waiting.

Suggested fix
-    let _ = self.run_on_main_thread(move || {
+    if self.run_on_main_thread(move || {
       let mtm = objc2::MainThreadMarker::new().unwrap();
       let ui_application = objc2_ui_kit::UIApplication::sharedApplication(mtm);
       tx.send(ui_application.supportsMultipleScenes()).unwrap();
-    });
+    }).is_err() {
+      return false;
+    }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/tauri/src/app.rs` around lines 680 - 687, `supports_multiple_windows`
currently ignores the result of `run_on_main_thread`, which can leave
`rx.recv()` waiting forever if dispatch fails. Update
`App::supports_multiple_windows` to check the `run_on_main_thread` call result
and return `false` immediately on failure before attempting to receive from the
channel; keep the existing `tx`/`rx` flow only for the successful path.
🧹 Nitpick comments (1)
.github/workflows/lint-rust.yml (1)

56-79: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Consider disabling credential persistence on checkout.

zizmor flags that actions/checkout@v7 at Line 59 doesn't set persist-credentials: false, leaving the GITHUB_TOKEN written to disk for the remainder of the job (all subsequent steps, including cargo/cross invocations that pull external code). Cheap hardening for defense-in-depth even though this workflow only runs trusted clippy.

🔒 Proposed fix
       - uses: actions/checkout@v7
+        with:
+          persist-credentials: false
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/lint-rust.yml around lines 56 - 79, The checkout step in
the lint-rust workflow leaves GitHub credentials persisted on disk. Update the
`actions/checkout@v7` step to disable credential persistence so the
`GITHUB_TOKEN` is not retained for later steps like `cargo` or `cross`; this is
the only change needed in the workflow’s checkout configuration.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/tauri/src/webview/webview_window.rs`:
- Around line 1282-1300: The iOS doc example in WebviewWindowBuilder uses an
undefined variable name, so update the snippet to use the existing builder
variable consistently when chaining with_input_accessory_view_builder. Keep the
example anchored to WebviewWindowBuilder::new and builder.build() so it compiles
and clearly shows the accessory view being applied.

In `@ports/tray-icon/README.md`:
- Around line 26-35: The Linux dependencies section has an inconsistent heading
depth, with the Arch Linux / Manjaro and Debian / Ubuntu subsections skipping a
level under Dependencies (Linux Only). Adjust those subsection headings in
README.md to match the surrounding hierarchy so the markdown structure stays
consistent and markdownlint is satisfied.

---

Outside diff comments:
In `@crates/tauri/src/app.rs`:
- Around line 680-687: `supports_multiple_windows` currently ignores the result
of `run_on_main_thread`, which can leave `rx.recv()` waiting forever if dispatch
fails. Update `App::supports_multiple_windows` to check the `run_on_main_thread`
call result and return `false` immediately on failure before attempting to
receive from the channel; keep the existing `tx`/`rx` flow only for the
successful path.

---

Nitpick comments:
In @.github/workflows/lint-rust.yml:
- Around line 56-79: The checkout step in the lint-rust workflow leaves GitHub
credentials persisted on disk. Update the `actions/checkout@v7` step to disable
credential persistence so the `GITHUB_TOKEN` is not retained for later steps
like `cargo` or `cross`; this is the only change needed in the workflow’s
checkout configuration.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 4af55f4e-e60e-4e1d-b6a2-c9826d17ad20

📥 Commits

Reviewing files that changed from the base of the PR and between 246f8f3 and f7472de.

⛔ Files ignored due to path filters (2)
  • Cargo.lock is excluded by !**/*.lock
  • ports/tray-icon/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (23)
  • .changes/change-pr-15677.md
  • .github/workflows/lint-rust.yml
  • audits/GTK4_WebKit6_supply_chain_notes.md
  • crates/tauri-bundler/Cargo.toml
  • crates/tauri-cli/config.schema.json
  • crates/tauri-cli/src/helpers/pbxproj.rs
  • crates/tauri-runtime-wry/src/lib.rs
  • crates/tauri-runtime-wry/src/window/macos.rs
  • crates/tauri-runtime-wry/src/window/mod.rs
  • crates/tauri-schema-generator/schemas/config.schema.json
  • crates/tauri-utils/Cargo.toml
  • crates/tauri-utils/src/config.rs
  • crates/tauri/src/app.rs
  • crates/tauri/src/lib.rs
  • crates/tauri/src/plugin/mobile.rs
  • crates/tauri/src/test/mock_runtime.rs
  • crates/tauri/src/tray/mod.rs
  • crates/tauri/src/webview/webview_window.rs
  • examples/api/src-tauri/src/lib.rs
  • ports/tao/src/platform_impl/linux/icon.rs
  • ports/tray-icon/README.md
  • ports/tray-icon/src/lib.rs
  • supply-chain/config.toml

Comment on lines +1282 to 1300
/// tauri::Builder::default()
/// .setup(|app| {
/// let mut builder = tauri::WebviewWindowBuilder::new(app, "label", tauri::WebviewUrl::App("index.html".into()));
/// #[cfg(target_os = "ios")]
/// {
/// window_builder = window_builder.with_input_accessory_view_builder(|_webview| unsafe {
/// let mtm = objc2::MainThreadMarker::new_unchecked();
/// let button = objc2_ui_kit::UIButton::buttonWithType(objc2_ui_kit::UIButtonType(1), mtm);
/// button.setTitle_forState(
/// Some(&objc2_foundation::NSString::from_str("Tauri")),
/// objc2_ui_kit::UIControlState(0),
/// );
/// Some(button.downcast().unwrap())
/// });
/// }
/// let webview = builder.build()?;
/// Ok(())
/// });
/// ```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the relevant section with line numbers
sed -n '1260,1310p' crates/tauri/src/webview/webview_window.rs | cat -n

# Search for the method usage elsewhere in the repository
rg -n "with_input_accessory_view_builder|window_builder|let mut builder = tauri::WebviewWindowBuilder::new" crates/tauri -S

Repository: OlympusLedgerOrg/tauri

Length of output: 1967


Fix the iOS doc example's builder variable

window_builder is undefined here; use builder = builder.with_input_accessory_view_builder(...) so the example compiles and the accessory view is applied.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/tauri/src/webview/webview_window.rs` around lines 1282 - 1300, The iOS
doc example in WebviewWindowBuilder uses an undefined variable name, so update
the snippet to use the existing builder variable consistently when chaining
with_input_accessory_view_builder. Keep the example anchored to
WebviewWindowBuilder::new and builder.build() so it compiles and clearly shows
the accessory view being applied.

Comment thread ports/tray-icon/README.md Outdated
Comment on lines +26 to +35
#### Arch Linux / Manjaro:

```sh
pacman -S gtk3 xdotool libappindicator-gtk3 #or libayatana-appindicator
pacman -S gtk4 xdotool dbus
```

#### Debian / Ubuntu:

```sh
sudo apt install libgtk-3-dev libxdo-dev libappindicator3-dev #or libayatana-appindicator3-dev
sudo apt install libgtk-4-dev libxdo-dev libdbus-1-dev

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Keep the markdown heading depth consistent.

#### skips a level under ## Dependencies (Linux Only), which trips the markdownlint warning and makes the section hierarchy harder to scan.

Suggested fix
-#### Arch Linux / Manjaro:
+### Arch Linux / Manjaro:
@@
-#### Debian / Ubuntu:
+### Debian / Ubuntu:
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
#### Arch Linux / Manjaro:
```sh
pacman -S gtk3 xdotool libappindicator-gtk3 #or libayatana-appindicator
pacman -S gtk4 xdotool dbus
```
#### Debian / Ubuntu:
```sh
sudo apt install libgtk-3-dev libxdo-dev libappindicator3-dev #or libayatana-appindicator3-dev
sudo apt install libgtk-4-dev libxdo-dev libdbus-1-dev
### Arch Linux / Manjaro:
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)

[warning] 26-26: Heading levels should only increment by one level at a time
Expected: h3; Actual: h4

(MD001, heading-increment)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ports/tray-icon/README.md` around lines 26 - 35, The Linux dependencies
section has an inconsistent heading depth, with the Arch Linux / Manjaro and
Debian / Ubuntu subsections skipping a level under Dependencies (Linux Only).
Adjust those subsection headings in README.md to match the surrounding hierarchy
so the markdown structure stays consistent and markdownlint is satisfied.

Source: Linters/SAST tools

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedcargo/​schemars@​0.8.22 ⏵ 0.8.2191100100100100

View full report

@OlympusLedgerOrg
OlympusLedgerOrg merged commit f35ed78 into gtk4-webkit6-tao-wry Jul 8, 2026
33 checks passed
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.

3 participants