Skip to content

Switch away from deprecated GtkShortcutsWindow#274

Open
linkmauve wants to merge 1 commit intomarin-m:mainfrom
linkmauve:adw-shortcuts-dialog
Open

Switch away from deprecated GtkShortcutsWindow#274
linkmauve wants to merge 1 commit intomarin-m:mainfrom
linkmauve:adw-shortcuts-dialog

Conversation

@linkmauve
Copy link
Copy Markdown
Contributor

@linkmauve linkmauve commented Apr 20, 2026

libadwaita now provides AdwShortcutsDialog, which integrates much better with the rest of the application, has a built-in search entry (well, we only got five shortcuts, but still!), doesn’t popup a different window, and doesn’t require any special code to handle as it is setup by the AdwApplication automatically.

I’ve also added a menu entry to display this dialog, in addition to the <Primary>question shortcut to make it more easily discoverable.

This bumps the minimum libadwaita version from 1.5 to 1.8, I don’t know what’s your policy related to those bumps.

libadwaita now provides AdwShortcutsDialog, which integrates much better
with the rest of the application, has a built-in search entry (well, we
only got five shortcuts, but still!), doesn’t popup a different window,
and doesn’t require any special code to handle as it is setup by the
AdwApplication automatically.

I’ve also added a menu entry to display this dialog, in addition to the
<Primary>question shortcut to make it more easily discoverable.

This bumps the minimum libadwaita version from 1.5 to 1.8, I don’t know
what’s your policy related to those bumps.
@linkmauve linkmauve force-pushed the adw-shortcuts-dialog branch from d1b5e9f to 03c7c74 Compare April 20, 2026 10:48
@marin-m
Copy link
Copy Markdown
Owner

marin-m commented Apr 20, 2026

Hello,

The current target for SongRec is libadwaita 1.5, which is the version available in the Ubuntu 24.04 LTS repositories (https://packages.ubuntu.com/noble/libadwaita-1-0), and Adw.ShortcutsDialog is indeed only available since libadwaita 1.8.

The compatibility is needed because we still push updates for the current Ubuntu LTS through the PPA distribution.

Regards,

@linkmauve
Copy link
Copy Markdown
Contributor Author

linkmauve commented Apr 20, 2026

Hmm, I get deprecation warnings from GtkShortcutsWindow (in addition to all of the things I mentioned above) running on GTK 4.22… Would there be a better solution to maybe support both and pick the best widget at runtime, based on the available library versions?

Although I guess deprecation means nothing as long as we stay on GTK 4.

@marin-m
Copy link
Copy Markdown
Owner

marin-m commented Apr 20, 2026

Would there be a better solution to maybe support both and pick the best widget at runtime, based on the available library versions?

This would incur some conditional compilation overhead, including having conditions around the loaded resource files, as Gtk.Builder won't accept to load a file containing an unknown widget:

thread 'main' (2606524) panicked at src/gui/main_window.rs:125:14:
called `Result::unwrap()` on an `Err` value: Error { domain: gtk-builder-error-quark, code: 6, message: ".:18:4032 Invalid object type 'AdwInexistingWidgetName'" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Also it would require not to have incompatible symbols linked to the ELF binary

Although I guess deprecation means nothing as long as we stay on GTK 4.

Indeed it's only informative

@marin-m marin-m assigned marin-m and unassigned marin-m May 4, 2026
@marin-m marin-m added the blocked label May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants