From 9b0c1b6f62bd52e1a6b91de86951432935ff7b37 Mon Sep 17 00:00:00 2001 From: Jehan Date: Fri, 31 Mar 2023 23:42:55 +0200 Subject: [PATCH] app, menus: fix the "Recently Closed Docks" auto-filling menu. It was actually working fine except that I wrongly named the submenu somehow, but even more particularly I thought it was about single dockables (tabs) whereas it was about full detached docks (a window containing several dockables/tabs). --- app/menus/windows-menu.c | 1 - app/widgets/gimpactionimpl.c | 8 +++++++- menus/image-menu.ui.in | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/menus/windows-menu.c b/app/menus/windows-menu.c index daee3e3e12..4925cf2fa2 100644 --- a/app/menus/windows-menu.c +++ b/app/menus/windows-menu.c @@ -255,7 +255,6 @@ windows_menu_recent_add (GimpContainer *container, action_name = g_strdup_printf ("windows-recent-%04d", info_id); - /* TODO GMenu: doesn't look like it's working, neither will old or new API. */ gimp_ui_manager_add_ui (manager, "/Windows/Recently Closed Docks", action_name, NULL, TRUE); diff --git a/app/widgets/gimpactionimpl.c b/app/widgets/gimpactionimpl.c index 3a8c190e15..1db941e521 100644 --- a/app/widgets/gimpactionimpl.c +++ b/app/widgets/gimpactionimpl.c @@ -283,9 +283,15 @@ static void gimp_action_impl_activate (GAction *action, GVariant *parameter) { + g_object_add_weak_pointer (G_OBJECT (action), (gpointer) &action); + gimp_action_emit_activate (GIMP_ACTION (action), parameter); - gimp_action_history_action_activated (GIMP_ACTION (action)); + if (action != NULL) + /* Some actions are self-destructive, such as the "windows-recent-*" + * actions which don't exist after being run. Don't log these. + */ + gimp_action_history_action_activated (GIMP_ACTION (action)); } static void diff --git a/menus/image-menu.ui.in b/menus/image-menu.ui.in index 2d4fbbe13f..a6dd9b1b0a 100644 --- a/menus/image-menu.ui.in +++ b/menus/image-menu.ui.in @@ -790,8 +790,8 @@ _Windows
- _Recently Closed Dialogs - + _Recently Closed Docks + _Dockable Dialogs