[gimp] Make layer selecting by actions work on the right container



commit b3e014759880c9dd5ff0f45595e60f7b82b52885
Author: Michael Natterer <mitch gimp org>
Date:   Sun Aug 2 12:01:17 2009 +0200

    Make layer selecting by actions work on the right container

 app/actions/layers-commands.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/app/actions/layers-commands.c b/app/actions/layers-commands.c
index 05e50ab..f1bac82 100644
--- a/app/actions/layers-commands.c
+++ b/app/actions/layers-commands.c
@@ -362,15 +362,21 @@ layers_select_cmd_callback (GtkAction *action,
                             gint       value,
                             gpointer   data)
 {
-  GimpImage *image;
-  GimpLayer *layer;
-  GimpLayer *new_layer;
+  GimpImage     *image;
+  GimpLayer     *layer;
+  GimpContainer *container;
+  GimpLayer     *new_layer;
   return_if_no_image (image, data);
 
   layer = gimp_image_get_active_layer (image);
 
+  if (layer)
+    container = gimp_item_get_container (GIMP_ITEM (layer));
+  else
+    container = gimp_image_get_layers (image);
+
   new_layer = (GimpLayer *) action_select_object ((GimpActionSelectType) value,
-                                                  image->layers,
+                                                  container,
                                                   (GimpObject *) layer);
 
   if (new_layer && new_layer != layer)



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