Bug 512771

Summary: Dragging a layer onto its own canvas duplicates it
Product: [Applications] krita Reporter: dra.w.p.il.e+bugskde
Component: UsabilityAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: 5.2.13   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description dra.w.p.il.e+bugskde 2025-11-29 23:09:50 UTC
When you drag a layer from the layer list onto a canvas, it will create a copy of that layer on that canvas. While that's useful if you're dragging between different canvases, doing it on the same canvas basically just leads to users accidentally duplicating layers if they are a bit too sloppy with selecting or reordering them.

Solution would be to check where the layer came from in the drop handler and not letting you drop a layer on the canvas it came from.
Comment 1 Bug Janitor Service 2025-12-06 10:01:57 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/2557
Comment 2 Dmitry Kazakov 2025-12-08 10:31:09 UTC
Git commit 7d6f717d0e2451e26b99a206e8441c59989ded58 by Dmitry Kazakov, on behalf of Carsten Hartenfels.
Committed on 08/12/2025 at 10:30.
Pushed by dkazakov into branch 'master'.

Don't allow dragging layers onto their own canvas

Because it really only ever gets used accidentally by users being a bit
sloppy about selecting or dragging layers, resulting in them duplicating
layers unintentionally.

M  +33   -21   libs/ui/KisView.cpp
M  +2    -0    libs/ui/KisView.h
M  +6    -0    libs/ui/kis_mimedata.cpp
M  +2    -0    libs/ui/kis_mimedata.h

https://invent.kde.org/graphics/krita/-/commit/7d6f717d0e2451e26b99a206e8441c59989ded58
Comment 3 Dmitry Kazakov 2025-12-08 10:31:31 UTC
Git commit 261c8bd4af9e89c34a5bf49263653d5cc7f17373 by Dmitry Kazakov.
Committed on 08/12/2025 at 10:31.
Pushed by dkazakov into branch 'krita/5.2'.

Don't allow dragging layers onto their own canvas

Because it really only ever gets used accidentally by users being a bit
sloppy about selecting or dragging layers, resulting in them duplicating
layers unintentionally.


(cherry picked from commit 7d6f717d0e2451e26b99a206e8441c59989ded58)

Co-authored-by: Carsten Hartenfels <carsten.hartenfels@pm.me>

M  +33   -21   libs/ui/KisView.cpp
M  +2    -0    libs/ui/KisView.h
M  +6    -0    libs/ui/kis_mimedata.cpp
M  +2    -0    libs/ui/kis_mimedata.h

https://invent.kde.org/graphics/krita/-/commit/261c8bd4af9e89c34a5bf49263653d5cc7f17373