Skip to content

Commit

Permalink
fix(dialog): Pin rfd to 0.12 to prevent freeze on Linux (#796)
Browse files Browse the repository at this point in the history
* Do not use rfd 0.12.1

PolyMeilex/rfd#152
conflicts with the way tauri uses it.

> Yeah, this is a decent solution, not much else we can do about this global state bs on C side.
>
> This will obviously blow up as soon as someone has other code that also uses GTK, but let's ignore that for now, as I want to get rid of GTK backend one day anyway (#66).

Yes, Tauri is other code that also uses GTK, and it does, indeed, blow up. The best way around this is to stop using rfd entirely (they're planning to drop the GTK backend, which will probably break since the XDG Portal API doesn't cover message dialogs).

* Update dialog-pin-rfd.md

---------

Co-authored-by: Fabian-Lars <[email protected]>
  • Loading branch information
notriddle and FabianLars authored Dec 5, 2023
1 parent e7c72c9 commit 0e3e3d4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changes/dialog-pin-rfd.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"dialog": "patch"
---

Pin the version of `rfd` to 0.12.0. This is a workaround for [PolyMeilex/rfd#152](https://github.com/PolyMeilex/rfd/pull/152), in which rfd took over responsibility for `gtk_init` by running its own event loop thread.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion plugins/dialog/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ tauri-plugin-fs = { path = "../fs", version = "2.0.0-alpha.4" }
glib = "0.16"

[target."cfg(any(target_os = \"macos\", windows, target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies]
rfd = { version = "0.12", features = [ "gtk3", "common-controls-v6" ] }
rfd = { version = "=0.12.0", features = [ "gtk3", "common-controls-v6" ] }
raw-window-handle = "0.5"

[build-dependencies]
Expand Down

0 comments on commit 0e3e3d4

Please sign in to comment.