From ea61460c6fb58a9efbccbdd985c2a7f5748e4963 Mon Sep 17 00:00:00 2001 From: Alx Sa Date: Wed, 30 Jul 2025 03:36:38 +0000 Subject: [PATCH] actions: Use layer for lock check when mask is active Resolves #9287 In GIMP 2.10, before checking if the drawable was locked, we checked if it was a layer mask and switched to its layer if so. This is because the lock status is saved in the layer. In GIMP 3.0, we accidentally moved that check to the bottom during the conversion to multi-select. As a result, when switching to a layer mask, the lock content and lock position would always be turned off since we checked the wrong drawable. This patch restores the 2.10 order of checks so that we compare the lock status with the layer and not the mask. --- app/actions/drawable-actions.c | 46 +++++++++++++++++----------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/app/actions/drawable-actions.c b/app/actions/drawable-actions.c index ac9b902248..ab810ced3a 100644 --- a/app/actions/drawable-actions.c +++ b/app/actions/drawable-actions.c @@ -174,34 +174,34 @@ drawable_actions_update (GimpActionGroup *group, { GimpItem *item; - if (gimp_item_get_visible (iter->data)) - has_visible = TRUE; - - if (gimp_item_can_lock_content (iter->data)) - { - if (! gimp_item_get_lock_content (iter->data)) - locked = FALSE; - can_lock = TRUE; - } - - if (gimp_item_can_lock_position (iter->data)) - { - if (! gimp_item_get_lock_position (iter->data)) - locked_pos = FALSE; - can_lock_pos = TRUE; - } - - if (gimp_viewable_get_children (GIMP_VIEWABLE (iter->data))) - none_children = FALSE; - - if (! gimp_drawable_is_rgb (iter->data)) - all_rgb = FALSE; - if (GIMP_IS_LAYER_MASK (iter->data)) item = GIMP_ITEM (gimp_layer_mask_get_layer (GIMP_LAYER_MASK (iter->data))); else item = GIMP_ITEM (iter->data); + if (gimp_item_get_visible (item)) + has_visible = TRUE; + + if (gimp_item_can_lock_content (item)) + { + if (! gimp_item_get_lock_content (item)) + locked = FALSE; + can_lock = TRUE; + } + + if (gimp_item_can_lock_position (item)) + { + if (! gimp_item_get_lock_position (item)) + locked_pos = FALSE; + can_lock_pos = TRUE; + } + + if (gimp_viewable_get_children (GIMP_VIEWABLE (item))) + none_children = FALSE; + + if (! gimp_drawable_is_rgb (iter->data)) + all_rgb = FALSE; + if (gimp_item_is_content_locked (item, NULL)) all_writable = FALSE;