From e27353216c6590749abfef710e0778982bcddbcd Mon Sep 17 00:00:00 2001 From: Alx Sa Date: Sat, 20 Sep 2025 15:21:45 +0000 Subject: [PATCH] plug-ins: Fix display lag in Small Tiles Resolves #14932 In Small Tiles, we update the preview whenever the number of segments slider is dragged. However, while we reacted to the slider moving, we actually grab the number from the GimpProcedureConfig object. As a result, there's a lag between the signal firing and the config object updating, so we don't grab the latest change. This patch alters the signal to run when "notify::num-tiles" is called, resulting in the update function having the updated number. --- plug-ins/common/tile-small.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/plug-ins/common/tile-small.c b/plug-ins/common/tile-small.c index f8b80b4257..320dc2379d 100644 --- a/plug-ins/common/tile-small.c +++ b/plug-ins/common/tile-small.c @@ -119,8 +119,7 @@ static gboolean tileit_dialog (GimpProcedure *procedure, static void tileit_scale_update (GimpLabelSpin *entry, gint *value); -static void tileit_config_update (GimpLabelSpin *entry, - GimpProcedureConfig *config); +static void tileit_config_update (GimpProcedureConfig *config); static void tileit_exp_update (GtkWidget *widget, gpointer value); @@ -654,9 +653,9 @@ tileit_dialog (GimpProcedure *procedure, _("Number of Segments"), FALSE, FALSE); scale = gimp_procedure_dialog_get_scale_entry (GIMP_PROCEDURE_DIALOG (dialog), "num-tiles", 1); - g_signal_connect (scale, "value-changed", - G_CALLBACK (tileit_config_update), - config); + g_signal_connect_object (config, "notify::num-tiles", + G_CALLBACK (tileit_config_update), + NULL, 0); gimp_procedure_dialog_fill_frame (GIMP_PROCEDURE_DIALOG (dialog), "num-tiles-frame", @@ -896,8 +895,7 @@ tileit_scale_update (GimpLabelSpin *scale, } static void -tileit_config_update (GimpLabelSpin *scale, - GimpProcedureConfig *config) +tileit_config_update (GimpProcedureConfig *config) { g_object_get (config, "num-tiles", &itvals.numtiles,