-
-
Notifications
You must be signed in to change notification settings - Fork 262
fix(linux): Port to gtk4-rs #1104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
Package Changes Through f250ce8There are 1 changes which include tao with minor Planned Package VersionsThe following package releases are the planned based on the context of changes in this pull request.
Add another change file through the GitHub UI by following this link. Read about change files or the docs at github.com/jbolda/covector |
2483636 to
987aeae
Compare
|
Got busy with other things for a while, I started work on this again recently though. Working on porting Muda now, should have it working in the next couple days |
- Updated gtk 0.18 to gtk4 0.10 - Updated webkit2gtk 2.0.1 to webkit6 0.5 - Updated javascriptcore-rs to javascriptcore6 - Updated soup2 to soup3 - Removed X11 raw window handle embedding (unsupported in GTK4) - Updated all examples to use build_gtk() pattern - Added gtk4_simple.rs example - Fixed gtk_multiwebview with Grid layout for proper sizing - Updated CI workflows for libwebkitgtk-6.0-dev - Updated README with new package dependencies Based on tao GTK4 work by @conradhale (tauri-apps/tao#1104) Closes tauri-apps#1474 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Hey @conradhale! Thanks for the GTK4 tao work - I used it as the foundation for completing the wry GTK4 migration. My tao fork: https://github.com/rmakestrash-jpg/tao/tree/gtk4-v0.34.5 Changes on top of your work:
This enabled me to complete the full wry migration to webkit6: tauri-apps/wry#1530 Tested on Wayland and everything works great! Let me know if there's anything I can help with to get this merged. |
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 <noreply@anthropic.com>
Adds an optional `libadwaita` cargo feature that enables proper GNOME HIG styling when building for Linux. When enabled: - Uses `adw::Application` instead of `gtk::Application` - Calls `adw::init()` for libadwaita initialization - Extends `adw::ApplicationWindow` in the window wrapper - Implements `AdwApplicationWindowImpl` trait This completes the libadwaita TODO from PR tauri-apps#1104. The feature is opt-in to maintain compatibility with non-GNOME desktops (KDE, XFCE, etc.). System requirement: libadwaita-1-dev (Debian/Ubuntu) or equivalent. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Closes #1051
You can find more info on most of the changes in the GTK docs
Summary of changes
Most of the X11-specific features have been removed from GTK4. This includes getting/setting window position, setting cursor position, getting global coordinates of pointer, setting window level (always-on-top), making window visible on all workspaces, and setting the skip taskbar hint.
Some of these methods can still be found in gdk-x11, however, X11 support is set to be completely removed from GTK5, and has been deprecated in GTK4.18. I personally do not think it is worth the effort to add the extra code to continue supporting these features though. Most developers using TAO really shouldn't depend on X11-only features since the number of people using X11 is becoming increasingly small. Differences in behavior on X11 and Wayland is also in many cases a recipe for bugs.
I've also added some features that were previously missing from the Wayland backend, like getting the cursor position (relative to the surface), and setting the urgency hint for the window (uses xdg-activation like winit).
gtk-rs-core also removed MainContext::channel, so I've followed the reccomendation of using
context.spawn_local()withasync-channel.Also, due to the
GtkWidget::configure_eventbeing removed, I had to subclass GtkWindow to allow connecting to changes in the Window's size allocation, since thedefault-widthanddefault-heightproperty change notification are fired too late to be used for making layout changes.Finally, I switched to using gdk-x11 and gdk-wayland instead of gdk-x11-sys and gdk-wayland-sys. It's now possible to get the window xid and wl_surface id without unsafe code, making the raw_window_handle functions implementations closer to winit's.
Todo