From 74f0d9eb037dc24bdfd1f0f325e483e380451d32 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 8 May 2024 10:16:47 +0200 Subject: Adding upstream version 2.10.38. Signed-off-by: Daniel Baumann --- app/actions/data-commands.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'app/actions') diff --git a/app/actions/data-commands.c b/app/actions/data-commands.c index 9d71bda..d93a6b1 100644 --- a/app/actions/data-commands.c +++ b/app/actions/data-commands.c @@ -117,11 +117,15 @@ data_new_cmd_callback (GimpAction *action, if (data) { + GtkWidget *edit_button; + gimp_context_set_by_type (context, gimp_data_factory_view_get_children_type (view), GIMP_OBJECT (data)); - gtk_button_clicked (GTK_BUTTON (gimp_data_factory_view_get_edit_button (view))); + edit_button = gimp_data_factory_view_get_edit_button (view); + if (edit_button && gtk_widget_get_visible (edit_button)) + gtk_button_clicked (GTK_BUTTON (gimp_data_factory_view_get_edit_button (view))); } } } @@ -149,11 +153,15 @@ data_duplicate_cmd_callback (GimpAction *action, if (new_data) { + GtkWidget *edit_button; + gimp_context_set_by_type (context, gimp_data_factory_view_get_children_type (view), GIMP_OBJECT (new_data)); - gtk_button_clicked (GTK_BUTTON (gimp_data_factory_view_get_edit_button (view))); + edit_button = gimp_data_factory_view_get_edit_button (view); + if (edit_button && gtk_widget_get_visible (edit_button)) + gtk_button_clicked (GTK_BUTTON (gimp_data_factory_view_get_edit_button (view))); } } } @@ -288,6 +296,7 @@ data_edit_cmd_callback (GimpAction *action, GdkScreen *screen = gtk_widget_get_screen (GTK_WIDGET (view)); gint monitor = gimp_widget_get_monitor (GTK_WIDGET (view)); GtkWidget *dockable; + GtkWidget *editor = NULL; dockable = gimp_window_strategy_show_dockable_dialog (GIMP_WINDOW_STRATEGY (gimp_get_window_strategy (context->gimp)), @@ -298,7 +307,10 @@ data_edit_cmd_callback (GimpAction *action, g_variant_get_string (value, NULL)); - gimp_data_editor_set_data (GIMP_DATA_EDITOR (gtk_bin_get_child (GTK_BIN (dockable))), - data); + if (dockable) + editor = gtk_bin_get_child (GTK_BIN (dockable)); + + if (editor && GIMP_IS_DATA_EDITOR (editor)) + gimp_data_editor_set_data (GIMP_DATA_EDITOR (editor), data); } } -- cgit v1.2.3