Bug 425412

Summary: Safe assert when pressing ctrl-c, ctrl-v
Product: [Applications] krita Reporter: Halla Rempt <halla>
Component: Layer StackAssignee: Dmitry Kazakov <dimula73>
Status: RESOLVED FIXED    
Severity: normal CC: ahab.greybeard
Priority: NOR Keywords: regression, release_blocker
Version: 4.3.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:

Description Halla Rempt 2020-08-16 08:13:14 UTC
Both in krita/4.3 and master:

* Open an image with layers
* Select a layer
* Press ctrl-c, ctrl-v

Result:

SAFE ASSERT (krita): "newAbove->parent()" in file /home/boud/dev/4.3/libs/ui/kis_node_juggler_compressed.cpp, line 481
Comment 1 Halla Rempt 2020-08-16 09:09:19 UTC
This assert also went off when I tried to quick group four layers each with a selection mask with ctrl-g. There was no backtrace.
Comment 2 Ahab Greybeard 2020-08-17 18:41:40 UTC
Do you mean 4.3.1, not 4.3.0?

That assert also goes off for https://bugs.kde.org/show_bug.cgi?id=425466
so it may be the same root cause (or a duplicate bug).
Comment 3 Dmitry Kazakov 2020-08-17 19:02:09 UTC
This bug has been introduced by my patch from fraday. I'll fix that
Comment 4 Dmitry Kazakov 2020-08-17 22:57:42 UTC
Git commit 1893c0a79a225d01b0bb364bafe6bb37cd23315c by Dmitry Kazakov.
Committed on 17/08/2020 at 22:57.
Pushed by dkazakov into branch 'krita/4.3'.

Fix actions not to modify locked layers

1) When trying to D&D **from** a locked layer Krita will
   force a "copy" mode

2) When trying to D&D **into** a locked group the operation will
   be forbidden. If the user still managed to do that, the layer
   will be put into a new position.

3) Layer->Properties should not be allowed for locked layers or
   masks.

4) Layer->Convert should not be allowed for locked layers

5) Lower/Raise node should not move nodes in a locked group

6) Lower/Raise node should not try to enter a locked group
Related: bug 406697

M  +18   -5    libs/ui/kis_layer_manager.cc
M  +9    -15   libs/ui/kis_mask_manager.cc
M  +17   -13   libs/ui/kis_node_juggler_compressed.cpp
M  +84   -29   libs/ui/kis_node_manager.cpp
M  +8    -1    libs/ui/kis_node_manager.h
M  +7    -3    libs/ui/kis_node_model.cpp

https://invent.kde.org/graphics/krita/commit/1893c0a79a225d01b0bb364bafe6bb37cd23315c
Comment 5 Dmitry Kazakov 2020-08-17 23:24:48 UTC
Git commit e885115b21a96c47734a126fd3de43f71e897f95 by Dmitry Kazakov.
Committed on 17/08/2020 at 23:00.
Pushed by dkazakov into branch 'master'.

Fix actions not to modify locked layers

1) When trying to D&D **from** a locked layer Krita will
   force a "copy" mode

2) When trying to D&D **into** a locked group the operation will
   be forbidden. If the user still managed to do that, the layer
   will be put into a new position.

3) Layer->Properties should not be allowed for locked layers or
   masks.

4) Layer->Convert should not be allowed for locked layers

5) Lower/Raise node should not move nodes in a locked group

6) Lower/Raise node should not try to enter a locked group
Related: bug 406697

# Conflicts:
#	libs/ui/kis_layer_manager.cc
#	libs/ui/kis_mask_manager.cc

M  +19   -4    libs/ui/kis_layer_manager.cc
M  +9    -15   libs/ui/kis_mask_manager.cc
M  +17   -13   libs/ui/kis_node_juggler_compressed.cpp
M  +84   -29   libs/ui/kis_node_manager.cpp
M  +8    -1    libs/ui/kis_node_manager.h
M  +7    -3    libs/ui/kis_node_model.cpp

https://invent.kde.org/graphics/krita/commit/e885115b21a96c47734a126fd3de43f71e897f95