Skip to content

[0.16.x] gtk3: Don't use the message description as a format string - #353

Merged
PolyMeilex merged 1 commit into
PolyMeilex:0.16.xfrom
jay-tau:gtk3-message-description-format-0.16
Oct 20, 2026
Merged

PolyMeilex merged 1 commit into
PolyMeilex:0.16.xfrom
jay-tau:gtk3-message-description-format-0.16

Conversation

@jay-tau

@jay-tau jay-tau commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Backport of #344 to 0.16.x, for a 0.16.1. tauri-plugin-dialog 2.8.3 and 3.0.0-alpha.4 both require rfd ^0.16, so Tauri apps could pick up the fix with cargo update -p rfd.

The change matches 9eb59f2 on master, except that the format is written as b"%s\0", like the existing title format in the same function, instead of c"%s". C string literals need Rust 1.77, and 0.16 doesn't declare a minimum Rust version, so I didn't want a patch release to need a newer compiler. Because of that, Clippy reports one new manual_c_str_literals warning, the same warning it already reports for the title format.

The changelog entry is under Unreleased, so you can choose the version heading. I didn't bump the version.

Testing

I built a small binary against 0.16.0 from crates.io and against this branch with default-features = false, features = ["gtk3"], and showed each description with both MessageDialog::show and AsyncMessageDialog::show in a headless mutter session (GTK 3.24.52, GLib 2.90.1):

Description 0.16.0 This branch
Saved 100% of your files. Saved 10032f your files. Saved 100% of your files.
100%% 100% 100%%
%s%s%s%s segmentation fault %s%s%s%s

The sync and async paths gave the same results. cargo build and cargo test with --no-default-features --features gtk3, and cargo build --no-default-features --features xdg-portal,tokio, pass.

Backport of PolyMeilex#344 (master commit 9eb59f2) to 0.16.x. The description
is passed to gtk_message_dialog_format_secondary_text as the argument
of a "%s" format instead of as the format itself.

The format is written as b"%s\0", like the title format in the same
file, rather than master's c"%s": C string literals need Rust 1.77,
and 0.16 declares no minimum Rust version.
@jay-tau

jay-tau commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

The remaining red check is the Ubuntu XDG cargo-deny job. It reports unmaintained-dependency advisories for zbus_names 4.2.0 (RUSTSEC-2026-0371), zvariant 5.5.1 (RUSTSEC-2026-0370) and zvariant_derive 5.5.1 (RUSTSEC-2026-0372), through the 0.16.x XDG backend's ashpd 0.11 → zbus 5.6 dependency chain.

The separate Ubuntu XDG build and tests pass on the same commit, f8fae21b61, and both GTK jobs pass. The advisory-check failure does not demonstrate a GTK regression from this backport.

@PolyMeilex
PolyMeilex merged commit e940924 into PolyMeilex:0.16.x Oct 20, 2026
11 of 12 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.

2 participants