[gimp] app: allow gimp_blink_dockable() with a NULL widget identifier.



commit d848c86cd8fe7104e3f6c70a99bbb2cfb8b1a968
Author: Jehan <jehan girinstud io>
Date:   Sat Mar 5 22:59:55 2022 +0100

    app: allow gimp_blink_dockable() with a NULL widget identifier.
    
    It can be used this way simply to raise and blink a dockable.

 app/widgets/gimpwidgets-utils.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)
---
diff --git a/app/widgets/gimpwidgets-utils.c b/app/widgets/gimpwidgets-utils.c
index 71709c204a..b4cc12a86f 100644
--- a/app/widgets/gimpwidgets-utils.c
+++ b/app/widgets/gimpwidgets-utils.c
@@ -1570,13 +1570,16 @@ gimp_blink_dockable (Gimp         *gimp,
   if (! dockable)
     return;
 
-  data = g_slice_new (BlinkData);
-  data->blink_script      = blink_scenario;
-  data->widget_identifier = widget_identifier;
-  gtk_container_foreach (GTK_CONTAINER (dockable),
-                         (GtkCallback) gimp_search_widget_rec,
-                         (gpointer) data);
-  g_slice_free (BlinkData, data);
+  if (widget_identifier)
+    {
+      data = g_slice_new (BlinkData);
+      data->blink_script      = blink_scenario;
+      data->widget_identifier = widget_identifier;
+      gtk_container_foreach (GTK_CONTAINER (dockable),
+                             (GtkCallback) gimp_search_widget_rec,
+                             (gpointer) data);
+      g_slice_free (BlinkData, data);
+    }
 }
 
 /**


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]