Skip to content

Conversation

@rmakestrash-jpg
Copy link

Summary

This PR migrates Tauri's Linux backend from GTK3/WebKitGTK 4.x to GTK4/WebKitGTK 6.0, modernizing the Linux platform support and enabling access to GTK4's improved APIs.

Motivation

GTK4 brings significant improvements including better rendering performance, modernized input handling, and continued upstream support. WebKitGTK 6.0 provides the latest web engine features and security updates. This migration ensures Tauri remains on actively maintained dependencies for the Linux platform.

Closes #12561
Closes #12562
Closes #12563
Related to #7335

Changes

tauri-runtime-wry

  • Migrate from gtk 0.18 to gtk4
  • Migrate from webkit2gtk to webkit6
  • Rewrite undecorated window resizing to use GTK4's GestureClick API (replaces the GTK3 event-based approach)
  • Update monitor code to use geometry() instead of the removed workarea() method

tauri-runtime

  • Update GTK4 type exports
  • Change webview type from webkit2gtk::WebView to webkit6::WebView

tauri

  • Remove temp_dir_path methods on Linux (no longer needed since ksni uses DBus directly rather than temp files)
  • Update webview type references

Dependencies

This PR depends on upstream work in related crates. The patch entries point to personal forks that track the following upstream PRs:

Crate Upstream PR Author
tao tauri-apps/tao#1104 @conradhale
wry tauri-apps/wry#1530 @conradhale
muda tauri-apps/muda#272 @amrbashir
tray-icon tauri-apps/tray-icon#201 @dfaust

I've commented on each upstream PR offering to help with integration testing:
tao#1104, wry#1530, muda#272, tray-icon#201

Note: All upstream PRs are currently in Draft status. This PR is submitted to facilitate integration testing and gather feedback while the dependency PRs are finalized.

Relationship to #12319

PR #12319 by @dfaust introduces ksni as an optional feature for tray icon support. This GTK4 PR makes ksni mandatory on GTK4 because libappindicator is incompatible with GTK4. The two approaches are:

Breaking Changes (Linux only)

  • TrayIconBuilder::temp_dir_path() - removed (ksni uses DBus, no temp files needed)
  • TrayIcon::set_temp_dir_path() - removed (ksni uses DBus, no temp files needed)

System Requirements

  • GTK4 4.6 or later
  • WebKitGTK 6.0 or later

Follow-up Work

A companion PR for plugins-workspace will be submitted separately to set xdg-portal as the default file picker on GTK4 (the GTK3 file chooser dialog is not available).

Test Plan

  • Build and run on Linux with GTK4
  • Test window creation, resizing, and decoration
  • Test tray icon functionality
  • Test webview rendering and JavaScript interop
  • Test menu functionality

🤖 Generated with Claude Code

rmakestrash-jpg and others added 7 commits December 14, 2025 11:25
- Update tauri-runtime-wry to use gtk4 0.10 and webkit6 0.5
- Update tauri-runtime to use gtk4 0.10 and webkit6 0.5
- Update tauri crate to use gtk4 0.10 and webkit6 0.5
- Replace webkit2gtk with webkit6 across all crates
- Fix IsA trait path: gtk::glib::IsA → gtk::prelude::IsA
- Update undecorated_resizing to use GTK4 GestureClick API
- Replace WindowEdge with SurfaceEdge for resize operations
- Replace workarea() with geometry() for monitor info
- Add workspace patches for wry-gtk4 and tao-gtk4

Note: muda and tray-icon still need GTK4 patches to compile

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Add linux-ksni feature to tray-icon dependency in crates/tauri
- Add workspace patches for wry, tao, muda, and tray-icon forks
- Use correct wry-gtk4/wry-upstream path for GTK4 wry fork

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Use #[cfg(not(target_os = "linux"))] on set_temp_dir_path methods
- Use cfg-gated imports for Path/PathBuf (maintainer pattern)
- temp_dir_path is not applicable on Linux with KSNI

Part of GTK4 migration for Tauri Linux support.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Point to public forks instead of local paths so the PR can be tested
by maintainers. These forks track the upstream GTK4 PRs:
- tao: tracks tauri-apps/tao#1104
- wry: tracks tauri-apps/wry#1530
- muda: tracks tauri-apps/muda#272
- tray-icon: tracks tauri-apps/tray-icon#201

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@rmakestrash-jpg rmakestrash-jpg requested a review from a team as a code owner December 21, 2025 21:47
@github-project-automation github-project-automation bot moved this to 📬Proposal in Roadmap Dec 21, 2025
@FabianLars FabianLars added the type: breaking change This issue or pull request will introduce a breaking change and requires major version bump label Dec 23, 2025
@FabianLars FabianLars added this to the 3.0 milestone Dec 23, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 25, 2025

Package Changes Through 296a2f3

There are 7 changes which include tauri-utils with patch, tauri-build with patch, tauri-cli with patch, @tauri-apps/cli with patch, tauri with minor, tauri-runtime-wry with minor, tauri-runtime with minor

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
tauri-utils 2.8.1 2.8.2
tauri-bundler 2.7.5 2.7.6
tauri-runtime 2.9.2 2.10.0
tauri-runtime-wry 2.9.3 2.10.0
tauri-codegen 2.5.2 2.5.3
tauri-macros 2.5.2 2.5.3
tauri-plugin 2.5.2 2.5.3
tauri-build 2.5.3 2.5.4
tauri 2.9.5 2.10.0
@tauri-apps/cli 2.9.6 2.9.7
tauri-cli 2.9.6 2.9.7

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

rmakestrash-jpg and others added 5 commits December 26, 2025 11:33
Forward tao/libadwaita feature through tauri-runtime-wry to tauri.
When enabled, uses libadwaita for proper GNOME styling (rounded corners,
themed menus, etc.) on Linux GTK4 builds.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
kristofvandam added a commit to kristofvandam/defguard-client that referenced this pull request Jan 4, 2026
* Adds `iproute2` to the wrapped `defguard-service`
* Adds `update-desktop-database` to the wrapped `defguard-client`
* Tauri Builds on the GTK3/WebKitGTK4.1, there was a mismatch with
  GTK4/WebKitGTK4.1, (GTK4 should use WebKitGTK6.0, but that isn't
  supported [yet](tauri-apps/tauri#14684) for tauri.
* No `Makefile` so we can overwrite/rename `postInstall` with
  `installPhase`.
* Formatting

With these changes in place, it fixes issue [DefGuard#728](DefGuard#728).
kristofvandam added a commit to kristofvandam/defguard-client that referenced this pull request Jan 4, 2026
* Adds `iproute2` to the wrapped `defguard-service`
* Adds `update-desktop-database` to the wrapped `defguard-client`
* Tauri Builds on the GTK3/WebKitGTK4.1, there was a mismatch with
  GTK4/WebKitGTK4.1, (GTK4 should use WebKitGTK6.0, but that isn't
  supported [yet](tauri-apps/tauri#14684) for tauri.
* No `Makefile` so we can overwrite/rename `postInstall` with
  `installPhase`.
* Formatting

With these changes in place, it fixes issue [DefGuard#728](DefGuard#728).
@aurelj
Copy link
Contributor

aurelj commented Jan 6, 2026

I tested this Gtk4 port (with your branches of tao/wry/...) and it is working fine with my project.
I hope this can get merged rather sooner than later.
I think it would be nice to move to tauri3 with Gtk3 without waiting for other potential breaking changes (we can go to tauri4 if other breaking changes needs it).

The only issue I found is in tao when disabling the x11 feature, and I sent a fix here : rmakestrash-jpg/tao#1

Thanks @rmakestrash-jpg for your work on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: breaking change This issue or pull request will introduce a breaking change and requires major version bump

Projects

Status: 📬Proposal

Development

Successfully merging this pull request may close these issues.

Upgrade tauri to gtk4-rs Upgrade tauri-runtime to gtk4-rs Upgrade tauri-runtime-wry to gtk4-rs

3 participants