From c4f71f553cb365b3b8e2d0c8d2d54394e6d27097 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Fri, 26 May 2023 15:25:15 +0200 Subject: [PATCH] app: fix action_data_get_image() to return NULL more often If "data" is a GimpItemTreeView or a GimpImageEditor, we REALLY want only the image from these dialogs, even if NULL, and NOT some other image from a display or context that randomly is around anyway. Fixes the sensitivity states of lots of buttons in these dialogs. --- app/actions/actions.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/actions/actions.c b/app/actions/actions.c index b4d8d12a8c..613c19f507 100644 --- a/app/actions/actions.c +++ b/app/actions/actions.c @@ -365,9 +365,17 @@ action_data_get_image (gpointer data) recursion = TRUE; if (GIMP_IS_ITEM_TREE_VIEW (data)) - result = gimp_item_tree_view_get_image ((GimpItemTreeView *) data); + { + result = gimp_item_tree_view_get_image ((GimpItemTreeView *) data); + recursion = FALSE; + return result; + } else if (GIMP_IS_IMAGE_EDITOR (data)) - result = ((GimpImageEditor *) data)->image; + { + result = ((GimpImageEditor *) data)->image; + recursion = FALSE; + return result; + } if (! result) {