From 48183a760028a72502bc1874b42e58c596269c6c Mon Sep 17 00:00:00 2001 From: Evan Paterakis Date: Mon, 5 Aug 2024 19:45:03 +0300 Subject: [PATCH 01/10] flatpak: bump 45 => 46 --- .github/workflows/flatpak.yml | 2 +- pkgs/flatpak/com.github.rafostar.Clapper.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/flatpak.yml b/.github/workflows/flatpak.yml index 5e203cde..2b05ff67 100644 --- a/.github/workflows/flatpak.yml +++ b/.github/workflows/flatpak.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 600 container: - image: bilelmoussaoui/flatpak-github-actions:gnome-45 + image: bilelmoussaoui/flatpak-github-actions:gnome-46 options: --privileged strategy: matrix: diff --git a/pkgs/flatpak/com.github.rafostar.Clapper.json b/pkgs/flatpak/com.github.rafostar.Clapper.json index cd8aac69..2999b337 100644 --- a/pkgs/flatpak/com.github.rafostar.Clapper.json +++ b/pkgs/flatpak/com.github.rafostar.Clapper.json @@ -1,7 +1,7 @@ { "app-id": "com.github.rafostar.Clapper", "runtime": "org.gnome.Platform", - "runtime-version": "45", + "runtime-version": "46", "sdk": "org.gnome.Sdk", "add-extensions": { "org.freedesktop.Platform.ffmpeg-full": { From 31bba1efb4f4390f56f46fa18090b841e13dd5d6 Mon Sep 17 00:00:00 2001 From: Evan Paterakis Date: Mon, 5 Aug 2024 19:58:19 +0300 Subject: [PATCH 02/10] clapper-app: uri-dialog: migrate to AdwAlertDialog AdwMessageDialog is deprecated on libadwaita 1.6. Additionally, replace GtkEntry with AdwEntryRow to better follow the HIG. --- src/bin/clapper-app/clapper-app-uri-dialog.c | 35 ++++++++----------- .../clapper-app/ui/clapper-app-uri-dialog.ui | 28 +++++++++------ 2 files changed, 32 insertions(+), 31 deletions(-) diff --git a/src/bin/clapper-app/clapper-app-uri-dialog.c b/src/bin/clapper-app/clapper-app-uri-dialog.c index a452f1e7..85ce174b 100644 --- a/src/bin/clapper-app/clapper-app-uri-dialog.c +++ b/src/bin/clapper-app/clapper-app-uri-dialog.c @@ -25,30 +25,27 @@ #include "clapper-app-utils.h" static void -_entry_text_changed_cb (GtkEntry *entry, - GParamSpec *pspec G_GNUC_UNUSED, AdwMessageDialog *dialog) +_entry_text_changed_cb (AdwEntryRow *entry, + GParamSpec *pspec G_GNUC_UNUSED, AdwAlertDialog *dialog) { - GtkEntryBuffer *buffer = gtk_entry_get_buffer (entry); - guint text_length = gtk_entry_buffer_get_length (buffer); + const gchar *text = gtk_editable_get_text (GTK_EDITABLE (entry)); gboolean enabled = FALSE; - if (text_length > 0) { - const gchar *text = gtk_entry_buffer_get_text (buffer); + if (strlen (text) > 0) { enabled = (text && gst_uri_is_valid (text)); } - adw_message_dialog_set_response_enabled (dialog, "add", enabled); + adw_alert_dialog_set_response_enabled (dialog, "add", enabled); } static void -_open_uri_cb (AdwMessageDialog *dialog, GAsyncResult *result, GtkApplication *gtk_app) +_open_uri_cb (AdwAlertDialog *dialog, GAsyncResult *result, GtkApplication *gtk_app) { - const gchar *response = adw_message_dialog_choose_finish (dialog, result); + const gchar *response = adw_alert_dialog_choose_finish (dialog, result); if (strcmp (response, "add") == 0) { - GtkWidget *extra_child = adw_message_dialog_get_extra_child (dialog); - GtkEntryBuffer *buffer = gtk_entry_get_buffer (GTK_ENTRY (extra_child)); - const gchar *text = gtk_entry_buffer_get_text (buffer); + AdwEntryRow *extra_child = ADW_ENTRY_ROW (gtk_list_box_get_row_at_index (GTK_LIST_BOX (adw_alert_dialog_get_extra_child (dialog)), 0)); + const gchar *text = gtk_editable_get_text (GTK_EDITABLE (extra_child)); GFile **files = NULL; gint n_files = 0; @@ -62,7 +59,7 @@ _open_uri_cb (AdwMessageDialog *dialog, GAsyncResult *result, GtkApplication *gt static void _read_text_cb (GdkClipboard *clipboard, GAsyncResult *result, GtkWidget *extra_child) { - GtkEntry *entry = GTK_ENTRY (extra_child); + AdwEntryRow *entry = ADW_ENTRY_ROW (extra_child); GError *error = NULL; gchar *text = gdk_clipboard_read_text_finish (clipboard, result, &error); @@ -89,19 +86,17 @@ clapper_app_uri_dialog_open_uri (GtkApplication *gtk_app) { GtkWindow *window = gtk_application_get_active_window (gtk_app); GtkBuilder *builder; - AdwMessageDialog *dialog; + AdwAlertDialog *dialog; GtkWidget *extra_child; GdkDisplay *display; builder = gtk_builder_new_from_resource ( CLAPPER_APP_RESOURCE_PREFIX "/ui/clapper-app-uri-dialog.ui"); - dialog = ADW_MESSAGE_DIALOG (gtk_builder_get_object (builder, "dialog")); - gtk_window_set_transient_for (GTK_WINDOW (dialog), window); + dialog = ADW_ALERT_DIALOG (gtk_builder_get_object (builder, "dialog")); + extra_child = GTK_WIDGET (gtk_builder_get_object (builder, "entry_row")); - extra_child = adw_message_dialog_get_extra_child (dialog); - - g_signal_connect (GTK_ENTRY (extra_child), "notify::text", + g_signal_connect (GTK_EDITABLE (extra_child), "notify::text", G_CALLBACK (_entry_text_changed_cb), dialog); if ((display = gdk_display_get_default ())) { @@ -112,7 +107,7 @@ clapper_app_uri_dialog_open_uri (GtkApplication *gtk_app) } /* NOTE: Dialog will automatically unref itself after response */ - adw_message_dialog_choose (dialog, NULL, + adw_alert_dialog_choose (dialog, GTK_WIDGET (window), NULL, (GAsyncReadyCallback) _open_uri_cb, gtk_app); diff --git a/src/bin/clapper-app/ui/clapper-app-uri-dialog.ui b/src/bin/clapper-app/ui/clapper-app-uri-dialog.ui index 4ab5b3e6..9dde6949 100644 --- a/src/bin/clapper-app/ui/clapper-app-uri-dialog.ui +++ b/src/bin/clapper-app/ui/clapper-app-uri-dialog.ui @@ -1,21 +1,27 @@ - - true - 420 + Add URI Insert an URI to be added to playback queue cancel add + 0 - - fill - center - true - true - true - url - Enter or drop URI here + + 0 + + + + fill + center + true + true + url + Enter or drop URI here + + From 14b3558b5ff6090c4634bb6fcaf1c65ba987598f Mon Sep 17 00:00:00 2001 From: Evan Paterakis Date: Mon, 5 Aug 2024 19:59:10 +0300 Subject: [PATCH 03/10] clapper-app: about-window: migrate to AdwAboutDialog AdwAboutWindow is deprecated on libadwaita 1.6. --- ...ut-window.c => clapper-app-about-dialog.c} | 21 ++++++++----------- ...ut-window.h => clapper-app-about-dialog.h} | 2 +- src/bin/clapper-app/clapper-app-application.c | 6 ++---- src/bin/clapper-app/meson.build | 2 +- 4 files changed, 13 insertions(+), 18 deletions(-) rename src/bin/clapper-app/{clapper-app-about-window.c => clapper-app-about-dialog.c} (78%) rename src/bin/clapper-app/{clapper-app-about-window.h => clapper-app-about-dialog.h} (92%) diff --git a/src/bin/clapper-app/clapper-app-about-window.c b/src/bin/clapper-app/clapper-app-about-dialog.c similarity index 78% rename from src/bin/clapper-app/clapper-app-about-window.c rename to src/bin/clapper-app/clapper-app-about-dialog.c index 8362576c..c439316c 100644 --- a/src/bin/clapper-app/clapper-app-about-window.c +++ b/src/bin/clapper-app/clapper-app-about-dialog.c @@ -22,29 +22,26 @@ #include #include -#include "clapper-app-about-window.h" +#include "clapper-app-about-dialog.h" -GtkWidget * -clapper_app_about_window_new (GtkApplication *gtk_app) +void +clapper_app_about_dialog_new (GtkApplication *gtk_app) { - AdwAboutWindow *about; + AdwAboutDialog *about; GtkWindow *window; GString *string; gchar *gst_ver, *debug_info; - about = ADW_ABOUT_WINDOW (adw_about_window_new_from_appdata ( + about = ADW_ABOUT_DIALOG (adw_about_dialog_new_from_appdata ( CLAPPER_APP_RESOURCE_PREFIX "/data/metainfo/" CLAPPER_APP_ID ".metainfo.xml", NULL)); window = gtk_application_get_active_window (gtk_app); - gtk_window_set_modal (GTK_WINDOW (about), TRUE); - gtk_window_set_transient_for (GTK_WINDOW (about), window); - /* Also show development versions */ - adw_about_window_set_version (about, CLAPPER_VERSION_S); + adw_about_dialog_set_version (about, CLAPPER_VERSION_S); /* TRANSLATORS: Put your name(s) here for credits or leave untranslated */ - adw_about_window_set_translator_credits (about, _("translator-credits")); + adw_about_dialog_set_translator_credits (about, _("translator-credits")); string = g_string_new (NULL); @@ -66,8 +63,8 @@ clapper_app_about_window_new (GtkApplication *gtk_app) g_free (gst_ver); debug_info = g_string_free_and_steal (string); - adw_about_window_set_debug_info (about, debug_info); + adw_about_dialog_set_debug_info (about, debug_info); g_free (debug_info); - return GTK_WIDGET (about); + adw_dialog_present (ADW_DIALOG (about), GTK_WIDGET (window)); } diff --git a/src/bin/clapper-app/clapper-app-about-window.h b/src/bin/clapper-app/clapper-app-about-dialog.h similarity index 92% rename from src/bin/clapper-app/clapper-app-about-window.h rename to src/bin/clapper-app/clapper-app-about-dialog.h index 2051d0ff..2135b966 100644 --- a/src/bin/clapper-app/clapper-app-about-window.h +++ b/src/bin/clapper-app/clapper-app-about-dialog.h @@ -24,6 +24,6 @@ G_BEGIN_DECLS G_GNUC_INTERNAL -GtkWidget * clapper_app_about_window_new (GtkApplication *gtk_app); +void clapper_app_about_dialog_new (GtkApplication *gtk_app); G_END_DECLS diff --git a/src/bin/clapper-app/clapper-app-application.c b/src/bin/clapper-app/clapper-app-application.c index 57acbfa4..e4a53e5d 100644 --- a/src/bin/clapper-app/clapper-app-application.c +++ b/src/bin/clapper-app/clapper-app-application.c @@ -28,7 +28,7 @@ #include "clapper-app-uri-dialog.h" #include "clapper-app-info-window.h" #include "clapper-app-preferences-window.h" -#include "clapper-app-about-window.h" +#include "clapper-app-about-dialog.h" #include "clapper-app-utils.h" #define PERCENTAGE_ROUND(a) (round ((gdouble) a / 0.01) * 0.01) @@ -378,10 +378,8 @@ static void show_about (GSimpleAction *action, GVariant *param, gpointer user_data) { GtkApplication *gtk_app = GTK_APPLICATION (user_data); - GtkWidget *about_window; - about_window = clapper_app_about_window_new (gtk_app); - gtk_window_present (GTK_WINDOW (about_window)); + clapper_app_about_dialog_new (gtk_app); } GApplication * diff --git a/src/bin/clapper-app/meson.build b/src/bin/clapper-app/meson.build index 515e83cc..01ccb321 100644 --- a/src/bin/clapper-app/meson.build +++ b/src/bin/clapper-app/meson.build @@ -54,7 +54,7 @@ configure_file( ) clapperapp_sources = [ - 'clapper-app-about-window.c', + 'clapper-app-about-dialog.c', 'clapper-app-application.c', 'clapper-app-file-dialog.c', 'clapper-app-headerbar.c', From 5c0b73f75924e33e463c41ebf11a61f2422fd498 Mon Sep 17 00:00:00 2001 From: Evan Paterakis Date: Mon, 5 Aug 2024 22:03:07 +0300 Subject: [PATCH 04/10] meson: bump adw to 1.5.0 --- meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index e63689c0..e8dbf7fc 100644 --- a/meson.build +++ b/meson.build @@ -10,8 +10,8 @@ project('clapper', 'c', glib_req = '>= 2.76.0' gst_req = '>= 1.20.0' -gtk4_req = '>= 4.10.0' -adw_req = '>= 1.4.0' +gtk4_req = '>= 4.13.4' +adw_req = '>= 1.5.0' clapper_version = meson.project_version().split('-')[0] version_array = clapper_version.split('.') From 597555d2db807d1088feda36689c0d5c6da4f70a Mon Sep 17 00:00:00 2001 From: Evan Paterakis Date: Tue, 6 Aug 2024 19:45:34 +0300 Subject: [PATCH 05/10] meson: revert gtk4 version bump --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index e8dbf7fc..2d4cabe3 100644 --- a/meson.build +++ b/meson.build @@ -10,7 +10,7 @@ project('clapper', 'c', glib_req = '>= 2.76.0' gst_req = '>= 1.20.0' -gtk4_req = '>= 4.13.4' +gtk4_req = '>= 4.10.0' adw_req = '>= 1.5.0' clapper_version = meson.project_version().split('-')[0] From aa9a489aff74c696656d32c2d98f16a93196ce00 Mon Sep 17 00:00:00 2001 From: Evan Paterakis Date: Tue, 6 Aug 2024 19:47:13 +0300 Subject: [PATCH 06/10] clapper-app: about-dialog: do not present in constructor --- src/bin/clapper-app/clapper-app-about-dialog.c | 8 +++----- src/bin/clapper-app/clapper-app-about-dialog.h | 2 +- src/bin/clapper-app/clapper-app-application.c | 6 +++++- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/bin/clapper-app/clapper-app-about-dialog.c b/src/bin/clapper-app/clapper-app-about-dialog.c index c439316c..2142c723 100644 --- a/src/bin/clapper-app/clapper-app-about-dialog.c +++ b/src/bin/clapper-app/clapper-app-about-dialog.c @@ -24,18 +24,16 @@ #include "clapper-app-about-dialog.h" -void -clapper_app_about_dialog_new (GtkApplication *gtk_app) +GtkWidget * +clapper_app_about_dialog_new () { AdwAboutDialog *about; - GtkWindow *window; GString *string; gchar *gst_ver, *debug_info; about = ADW_ABOUT_DIALOG (adw_about_dialog_new_from_appdata ( CLAPPER_APP_RESOURCE_PREFIX "/data/metainfo/" CLAPPER_APP_ID ".metainfo.xml", NULL)); - window = gtk_application_get_active_window (gtk_app); /* Also show development versions */ adw_about_dialog_set_version (about, CLAPPER_VERSION_S); @@ -66,5 +64,5 @@ clapper_app_about_dialog_new (GtkApplication *gtk_app) adw_about_dialog_set_debug_info (about, debug_info); g_free (debug_info); - adw_dialog_present (ADW_DIALOG (about), GTK_WIDGET (window)); + return GTK_WIDGET (about); } diff --git a/src/bin/clapper-app/clapper-app-about-dialog.h b/src/bin/clapper-app/clapper-app-about-dialog.h index 2135b966..2fa6ab64 100644 --- a/src/bin/clapper-app/clapper-app-about-dialog.h +++ b/src/bin/clapper-app/clapper-app-about-dialog.h @@ -24,6 +24,6 @@ G_BEGIN_DECLS G_GNUC_INTERNAL -void clapper_app_about_dialog_new (GtkApplication *gtk_app); +GtkWidget * clapper_app_about_dialog_new (); G_END_DECLS diff --git a/src/bin/clapper-app/clapper-app-application.c b/src/bin/clapper-app/clapper-app-application.c index e4a53e5d..d40ee22a 100644 --- a/src/bin/clapper-app/clapper-app-application.c +++ b/src/bin/clapper-app/clapper-app-application.c @@ -378,8 +378,12 @@ static void show_about (GSimpleAction *action, GVariant *param, gpointer user_data) { GtkApplication *gtk_app = GTK_APPLICATION (user_data); + GtkWindow *window; + GtkWidget *about_dialog; - clapper_app_about_dialog_new (gtk_app); + window = gtk_application_get_active_window (gtk_app); + about_dialog = clapper_app_about_dialog_new (); + adw_dialog_present (ADW_DIALOG (about_dialog), GTK_WIDGET (window)); } GApplication * From bee6acbaf723722f7e24527c830b39f8cf4dbc13 Mon Sep 17 00:00:00 2001 From: Evan Paterakis Date: Tue, 6 Aug 2024 19:48:37 +0300 Subject: [PATCH 07/10] clapper-app: uri-dialog: match coding style --- src/bin/clapper-app/clapper-app-uri-dialog.c | 15 +++++++++------ src/bin/clapper-app/ui/clapper-app-uri-dialog.ui | 8 ++++---- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/bin/clapper-app/clapper-app-uri-dialog.c b/src/bin/clapper-app/clapper-app-uri-dialog.c index 85ce174b..70783983 100644 --- a/src/bin/clapper-app/clapper-app-uri-dialog.c +++ b/src/bin/clapper-app/clapper-app-uri-dialog.c @@ -44,8 +44,11 @@ _open_uri_cb (AdwAlertDialog *dialog, GAsyncResult *result, GtkApplication *gtk_ const gchar *response = adw_alert_dialog_choose_finish (dialog, result); if (strcmp (response, "add") == 0) { - AdwEntryRow *extra_child = ADW_ENTRY_ROW (gtk_list_box_get_row_at_index (GTK_LIST_BOX (adw_alert_dialog_get_extra_child (dialog)), 0)); - const gchar *text = gtk_editable_get_text (GTK_EDITABLE (extra_child)); + GtkWidget *extra_child = adw_alert_dialog_get_extra_child (dialog); + GtkListBoxRow *list_row = gtk_list_box_get_row_at_index (GTK_LIST_BOX (extra_child), 0); + AdwEntryRow *entry_row = ADW_ENTRY_ROW (list_row); + + const gchar *text = gtk_editable_get_text (GTK_EDITABLE (entry_row)); GFile **files = NULL; gint n_files = 0; @@ -87,23 +90,23 @@ clapper_app_uri_dialog_open_uri (GtkApplication *gtk_app) GtkWindow *window = gtk_application_get_active_window (gtk_app); GtkBuilder *builder; AdwAlertDialog *dialog; - GtkWidget *extra_child; + GtkWidget *entry_row; GdkDisplay *display; builder = gtk_builder_new_from_resource ( CLAPPER_APP_RESOURCE_PREFIX "/ui/clapper-app-uri-dialog.ui"); dialog = ADW_ALERT_DIALOG (gtk_builder_get_object (builder, "dialog")); - extra_child = GTK_WIDGET (gtk_builder_get_object (builder, "entry_row")); + entry_row = GTK_WIDGET (gtk_builder_get_object (builder, "entry_row")); - g_signal_connect (GTK_EDITABLE (extra_child), "notify::text", + g_signal_connect (GTK_EDITABLE (entry_row), "notify::text", G_CALLBACK (_entry_text_changed_cb), dialog); if ((display = gdk_display_get_default ())) { GdkClipboard *clipboard = gdk_display_get_clipboard (display); gdk_clipboard_read_text_async (clipboard, NULL, - (GAsyncReadyCallback) _read_text_cb, extra_child); + (GAsyncReadyCallback) _read_text_cb, entry_row); } /* NOTE: Dialog will automatically unref itself after response */ diff --git a/src/bin/clapper-app/ui/clapper-app-uri-dialog.ui b/src/bin/clapper-app/ui/clapper-app-uri-dialog.ui index 9dde6949..faa10cb9 100644 --- a/src/bin/clapper-app/ui/clapper-app-uri-dialog.ui +++ b/src/bin/clapper-app/ui/clapper-app-uri-dialog.ui @@ -5,12 +5,12 @@ Insert an URI to be added to playback queue cancel add - 0 + false - - 0 + + none From dcf198f17bd5f563d276a7087bce6c642bd0c470 Mon Sep 17 00:00:00 2001 From: Evan Paterakis Date: Tue, 6 Aug 2024 21:27:53 +0300 Subject: [PATCH 08/10] clapper-app: about-dialog: set constructor params to void --- src/bin/clapper-app/clapper-app-about-dialog.c | 2 +- src/bin/clapper-app/clapper-app-about-dialog.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bin/clapper-app/clapper-app-about-dialog.c b/src/bin/clapper-app/clapper-app-about-dialog.c index 2142c723..1e4b6901 100644 --- a/src/bin/clapper-app/clapper-app-about-dialog.c +++ b/src/bin/clapper-app/clapper-app-about-dialog.c @@ -25,7 +25,7 @@ #include "clapper-app-about-dialog.h" GtkWidget * -clapper_app_about_dialog_new () +clapper_app_about_dialog_new (void) { AdwAboutDialog *about; GString *string; diff --git a/src/bin/clapper-app/clapper-app-about-dialog.h b/src/bin/clapper-app/clapper-app-about-dialog.h index 2fa6ab64..4658c8f4 100644 --- a/src/bin/clapper-app/clapper-app-about-dialog.h +++ b/src/bin/clapper-app/clapper-app-about-dialog.h @@ -24,6 +24,6 @@ G_BEGIN_DECLS G_GNUC_INTERNAL -GtkWidget * clapper_app_about_dialog_new (); +GtkWidget * clapper_app_about_dialog_new (void); G_END_DECLS From e954f1cab30dbf51feae67dd6c72b3fe742d7f5a Mon Sep 17 00:00:00 2001 From: Evan Paterakis Date: Tue, 6 Aug 2024 21:29:27 +0300 Subject: [PATCH 09/10] clapper-app: uri-dialog: check if text exists and is not empty --- src/bin/clapper-app/clapper-app-uri-dialog.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bin/clapper-app/clapper-app-uri-dialog.c b/src/bin/clapper-app/clapper-app-uri-dialog.c index 70783983..619cffdb 100644 --- a/src/bin/clapper-app/clapper-app-uri-dialog.c +++ b/src/bin/clapper-app/clapper-app-uri-dialog.c @@ -31,8 +31,8 @@ _entry_text_changed_cb (AdwEntryRow *entry, const gchar *text = gtk_editable_get_text (GTK_EDITABLE (entry)); gboolean enabled = FALSE; - if (strlen (text) > 0) { - enabled = (text && gst_uri_is_valid (text)); + if (text && *text != '\0') { + enabled = gst_uri_is_valid (text); } adw_alert_dialog_set_response_enabled (dialog, "add", enabled); From 1fc79fa603a7f21a8ce6079a6f3cff1cd4523124 Mon Sep 17 00:00:00 2001 From: Evan Paterakis Date: Tue, 6 Aug 2024 21:29:49 +0300 Subject: [PATCH 10/10] clapper-app: uri-dialog: match coding style --- src/bin/clapper-app/clapper-app-uri-dialog.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/bin/clapper-app/clapper-app-uri-dialog.c b/src/bin/clapper-app/clapper-app-uri-dialog.c index 619cffdb..16078b24 100644 --- a/src/bin/clapper-app/clapper-app-uri-dialog.c +++ b/src/bin/clapper-app/clapper-app-uri-dialog.c @@ -45,9 +45,7 @@ _open_uri_cb (AdwAlertDialog *dialog, GAsyncResult *result, GtkApplication *gtk_ if (strcmp (response, "add") == 0) { GtkWidget *extra_child = adw_alert_dialog_get_extra_child (dialog); - GtkListBoxRow *list_row = gtk_list_box_get_row_at_index (GTK_LIST_BOX (extra_child), 0); - AdwEntryRow *entry_row = ADW_ENTRY_ROW (list_row); - + AdwEntryRow *entry_row = ADW_ENTRY_ROW (gtk_list_box_get_row_at_index (GTK_LIST_BOX (extra_child), 0)); const gchar *text = gtk_editable_get_text (GTK_EDITABLE (entry_row)); GFile **files = NULL; gint n_files = 0; @@ -60,16 +58,15 @@ _open_uri_cb (AdwAlertDialog *dialog, GAsyncResult *result, GtkApplication *gtk_ } static void -_read_text_cb (GdkClipboard *clipboard, GAsyncResult *result, GtkWidget *extra_child) +_read_text_cb (GdkClipboard *clipboard, GAsyncResult *result, GtkWidget *entry_row) { - AdwEntryRow *entry = ADW_ENTRY_ROW (extra_child); GError *error = NULL; gchar *text = gdk_clipboard_read_text_finish (clipboard, result, &error); if (G_LIKELY (error == NULL)) { if (gst_uri_is_valid (text)) { - gtk_editable_set_text (GTK_EDITABLE (entry), text); - gtk_editable_select_region (GTK_EDITABLE (entry), 0, -1); + gtk_editable_set_text (GTK_EDITABLE (entry_row), text); + gtk_editable_select_region (GTK_EDITABLE (entry_row), 0, -1); } } else { /* Common error when clipboard is empty or has unsupported content.