Skip to content

Conversation

@conradhale
Copy link

@conradhale conradhale commented Mar 25, 2025

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() with async-channel.

Also, due to the GtkWidget::configure_event being removed, I had to subclass GtkWindow to allow connecting to changes in the Window's size allocation, since the default-width and default-height property 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

  • Support creating window with Libadwaita (Enabled via cargo feature probably).
  • Update .changes
  • Test on X11

@github-actions
Copy link
Contributor

Package Changes Through f250ce8

There are 1 changes which include tao 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
tao 0.32.8 0.33.0

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


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

@conradhale conradhale force-pushed the dev branch 2 times, most recently from 2483636 to 987aeae Compare March 30, 2025 20:59
@conradhale
Copy link
Author

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

rmakestrash-jpg added a commit to rmakestrash-jpg/wry that referenced this pull request Dec 21, 2025
- 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>
@rmakestrash-jpg
Copy link

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:

  • Upgraded gtk4 from 0.9 to 0.10 (required for wry webkit6 compatibility)
  • Updated Cargo.lock

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.

rmakestrash-jpg added a commit to rmakestrash-jpg/tauri that referenced this pull request Dec 21, 2025
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>
rmakestrash-jpg added a commit to rmakestrash-jpg/tao that referenced this pull request Dec 27, 2025
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>
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.

Upgrade tao to gtk4-rs

2 participants