diff -Nru geeqie-2.5/debian/changelog geeqie-2.5/debian/changelog --- geeqie-2.5/debian/changelog 2025-04-02 13:25:17.000000000 +0200 +++ geeqie-2.5/debian/changelog 2025-06-07 13:44:17.000000000 +0200 @@ -1,3 +1,9 @@ +geeqie (1:2.5-6) unstable; urgency=medium + + * Add patch to fix crash on keyword autocomplete (Closes: #1107397) + + -- Andreas Rönnquist Sat, 07 Jun 2025 13:44:17 +0200 + geeqie (1:2.5-5) unstable; urgency=medium * Add patch to make 'Hide Bars and Files' not nuke toolbars diff -Nru geeqie-2.5/debian/patches/Fix-1768-Crash-on-keyword-autocomplete-command.patch geeqie-2.5/debian/patches/Fix-1768-Crash-on-keyword-autocomplete-command.patch --- geeqie-2.5/debian/patches/Fix-1768-Crash-on-keyword-autocomplete-command.patch 1970-01-01 01:00:00.000000000 +0100 +++ geeqie-2.5/debian/patches/Fix-1768-Crash-on-keyword-autocomplete-command.patch 2025-06-07 13:44:05.000000000 +0200 @@ -0,0 +1,98 @@ +From: Colin Clark +Date: Sat, 7 Jun 2025 12:05:33 +0100 +Subject: Fix #1768: Crash on "keyword autocomplete" command + +https://github.com/BestImageViewer/geeqie/issues/1768 + +Check if the keywords pane has been initialized, and if not send an +application notification. +--- + scripts/untranslated-text.sh | 1 + + src/bar-keywords.cc | 36 ++++++++++++++++++++++++++---------- + src/bar.cc | 5 +++++ + 3 files changed, 32 insertions(+), 10 deletions(-) + +diff --git a/scripts/untranslated-text.sh b/scripts/untranslated-text.sh +index 2495047..be19e5a 100755 +--- a/scripts/untranslated-text.sh ++++ b/scripts/untranslated-text.sh +@@ -195,6 +195,7 @@ format-fuji.cc + format-nikon.cc + format-olympus.cc + keymap-template.cc ++bar-keywords.cc + " + + # A POSIX-compliant function that returns 0 if the substring is present, or 1 +diff --git a/src/bar-keywords.cc b/src/bar-keywords.cc +index 49ff475..dd1f6b3 100644 +--- a/src/bar-keywords.cc ++++ b/src/bar-keywords.cc +@@ -1950,25 +1950,41 @@ gboolean bar_keywords_autocomplete_focus(LayoutWindow *lw) + GtkWidget *pane; + GtkWidget *current_focus; + GList *children; +- gboolean ret; ++ gboolean ret = FALSE; + + current_focus = gtk_window_get_focus(GTK_WINDOW(lw->window)); + pane = bar_find_pane_by_id(lw->bar, PANE_KEYWORDS, "keywords"); + +- children = gtk_container_get_children(GTK_CONTAINER(pane)); +- +- const GList *last_child = g_list_last(children); +- if (current_focus == last_child->data) ++ if (pane) + { +- ret = TRUE; ++ children = gtk_container_get_children(GTK_CONTAINER(pane)); ++ ++ const GList *last_child = g_list_last(children); ++ if (current_focus == last_child->data) ++ { ++ ret = TRUE; ++ } ++ else ++ { ++ gtk_widget_grab_focus(GTK_WIDGET(last_child->data)); ++ ret = FALSE; ++ } ++ ++ g_list_free(children); + } + else + { +- gtk_widget_grab_focus(GTK_WIDGET(last_child->data)); +- ret = FALSE; +- } ++ GApplication *app = g_application_get_default(); + +- g_list_free(children); ++ g_autoptr(GNotification) notification = g_notification_new("Geeqie"); ++ ++ g_notification_set_title(notification, _("Keyword Autocomplete")); ++ g_notification_set_body(notification, _("The Info Sidebar has not yet been opened")); ++ g_notification_set_priority(notification, G_NOTIFICATION_PRIORITY_NORMAL); ++ g_notification_set_default_action(notification, "app.null"); ++ ++ g_application_send_notification(G_APPLICATION(app), "keyword-autocomplete-notification", notification); ++ } + + return ret; + } +diff --git a/src/bar.cc b/src/bar.cc +index 1a5e4c7..654a557 100644 +--- a/src/bar.cc ++++ b/src/bar.cc +@@ -575,6 +575,11 @@ GtkWidget *bar_find_pane_by_id(GtkWidget *bar, PaneType type, const gchar *id) + + if (!id || !id[0]) return nullptr; + ++ if (!bar) ++ { ++ return nullptr; ++ } ++ + bd = static_cast(g_object_get_data(G_OBJECT(bar), "bar_data")); + if (!bd) return nullptr; + diff -Nru geeqie-2.5/debian/patches/series geeqie-2.5/debian/patches/series --- geeqie-2.5/debian/patches/series 2025-04-02 12:59:55.000000000 +0200 +++ geeqie-2.5/debian/patches/series 2025-06-07 13:33:53.000000000 +0200 @@ -4,3 +4,4 @@ Fix-1462-Toolbar-looks-fixed-but-actions-don-t-work-befor.patch Check-for-GNU-user-space-instead-of-Linux-kernel.patch Fix-1692-Hide-Bars-and-Files-nukes-toolbar-customizations.patch +Fix-1768-Crash-on-keyword-autocomplete-command.patch