From 0747e161dd4fd089346b0c14d38229d612e53a5f Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 20 Jul 2026 19:53:36 +0300 Subject: shortcuts: fix the GtkBuilder UI XML so ? doesn't crash on startup The inline SHORTCUTS_UI string had mismatched closing tags (extra elements), so gtk_builder_new_from_string failed with "Element child was closed, but the currently open element is object" and aborted the process the moment ? was pressed. Regenerate the UI with correct / nesting (validated with xmllint). --- src/window.c | 252 +++++++++++++++++++++++++++++++++++------------------------ 1 file changed, 151 insertions(+), 101 deletions(-) (limited to 'src/window.c') diff --git a/src/window.c b/src/window.c index 50a6e04..8e74db8 100644 --- a/src/window.c +++ b/src/window.c @@ -299,107 +299,157 @@ _action_mark_all(GSimpleAction *p_a, GVariant *p_v, gpointer p_data) { /* GtkBuilder UI for the shortcuts overlay (?). Accel strings use gtk * accelerator syntax: "h Left" means h OR Left triggers it. */ static const char *SHORTCUTS_UI = - "" - " " - " True" - " shortcuts" - " " - " " - " shortcuts" - " ggaze" - " " - " " - " Navigation" - " " - " h Left" - " Previous " - "image" - " " - " l Right" - " Next " - "image" - " " - " g" - " First " - "image" - " " - " Shift+G" - " Last " - "image" - " " - " " - " " - " View" - " " - " t" - " Toggle large / " - "grid" - " " - " f" - " Fullscreen" - " " - " Shift+S" - " Slideshow" - " " - " i" - " Info " - "overlay" - " " - " " - " " - " Selection (marks)" - " " - " v" - " Toggle mark on " - "highlighted" - " " - " Ctrl+a" - " Mark all" - " " - " Escape" - " Clear marks / " - "back" - " " - " " - " " - " Files" - " " - " o" - " Open" - " " - " d" - " Trash" - " " - " Shift+D" - " Delete " - "permanently" - " " - " u" - " Undo" - " " - " q" - " Quit" - " " - " " - " " - " Zoom" - " " - " plus equal" - " Zoom in" - " " - " minus underscore" - " Zoom out" - " " - " question" - " Show this " - "help" - " " - " " - " " - " " - ""; + "\n" + " \n" + " True\n" + " shortcuts\n" + " \n" + " \n" + " shortcuts\n" + " ggaze\n" + " \n" + " \n" + " Navigation\n" + " \n" + " \n" + " h Left\n" + " Previous image\n" + " \n" + " \n" + " \n" + " \n" + " l Right\n" + " Next image\n" + " \n" + " \n" + " \n" + " \n" + " g\n" + " First image\n" + " \n" + " \n" + " \n" + " \n" + " Shift+G\n" + " Last image\n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " View\n" + " \n" + " \n" + " t\n" + " Toggle large / grid\n" + " \n" + " \n" + " \n" + " \n" + " f\n" + " Fullscreen\n" + " \n" + " \n" + " \n" + " \n" + " Shift+S\n" + " Slideshow\n" + " \n" + " \n" + " \n" + " \n" + " i\n" + " Info overlay\n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " Selection (marks)\n" + " \n" + " \n" + " v\n" + " Toggle mark on highlighted\n" + " \n" + " \n" + " \n" + " \n" + " Ctrl+a\n" + " Mark all\n" + " \n" + " \n" + " \n" + " \n" + " Escape\n" + " Clear marks / back\n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " Files\n" + " \n" + " \n" + " o\n" + " Open\n" + " \n" + " \n" + " \n" + " \n" + " d\n" + " Trash\n" + " \n" + " \n" + " \n" + " \n" + " Shift+D\n" + " Delete permanently\n" + " \n" + " \n" + " \n" + " \n" + " u\n" + " Undo\n" + " \n" + " \n" + " \n" + " \n" + " q\n" + " Quit\n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " Zoom\n" + " \n" + " \n" + " plus equal\n" + " Zoom in\n" + " \n" + " \n" + " \n" + " \n" + " minus underscore\n" + " Zoom out\n" + " \n" + " \n" + " \n" + " \n" + " question\n" + " Show this help\n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + "\n"; static void _action_shortcuts(GSimpleAction *p_a, GVariant *p_v, gpointer p_data) { -- cgit v1.2.3