[gimp] app: replace one more usage of gimp_image_get_active_drawable().



commit 48bebb8a27c3e5d5d08fdeaa0bc3afaafed0062d
Author: Jehan <jehan girinstud io>
Date:   Wed Oct 19 15:14:14 2022 +0200

    app: replace one more usage of gimp_image_get_active_drawable().

 app/actions/filters-actions.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/app/actions/filters-actions.c b/app/actions/filters-actions.c
index 46598d0b03..acadb309da 100644
--- a/app/actions/filters-actions.c
+++ b/app/actions/filters-actions.c
@@ -866,7 +866,6 @@ filters_actions_update (GimpActionGroup *group,
                         gpointer         data)
 {
   GimpImage    *image;
-  GimpDrawable *drawable       = NULL;
   gboolean      writable       = FALSE;
   gboolean      gray           = FALSE;
   gboolean      alpha          = FALSE;
@@ -876,11 +875,14 @@ filters_actions_update (GimpActionGroup *group,
 
   if (image)
     {
-      drawable = gimp_image_get_active_drawable (image);
+      GList *drawables;
 
-      if (drawable)
+      drawables = gimp_image_get_selected_drawables (image);
+
+      if (g_list_length (drawables) == 1)
         {
-          GimpItem *item;
+          GimpDrawable *drawable = drawables->data;
+          GimpItem     *item;
 
           gray           = gimp_drawable_is_gray (drawable);
           alpha          = gimp_drawable_has_alpha (drawable);
@@ -896,6 +898,8 @@ filters_actions_update (GimpActionGroup *group,
           if (gimp_viewable_get_children (GIMP_VIEWABLE (drawable)))
             writable = FALSE;
         }
+
+      g_list_free (drawables);
    }
 
 #define SET_SENSITIVE(action,condition) \


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