GNOME Bugzilla – Bug 78194
Drag and drop from layer mask should not create new layer
Last modified: 2018-05-24 10:42:38 UTC
Using drag and drop from a layer mask produces a different result than if you use copy and paste (Ctrl-C, Ctrl-V, Ctrl-H). Scenario: - You have two images open and the current layer in each image has a layer mask. - You drag the layer mask from the first image (by dragging it from the Layers dialog) and drop it on the second image. Current behavior: - A new layer is created in the second image, containing the (grayscale) contents of the layer mask. Expected behavior: - The contents of the layer mask are copied into the layer mask of the second image. This is what would happen if you do Edit->Copy (Ctrl-C) from the first image and then Edit->Paste (Ctrl-V) and then (Ctrl-H) on the second image (assuming that the layer mask is currently active in the second image). Creating a new layer in the second image may be a reasonable behavior if the second image has no layer mask or no alpha channel associated with the current layer, but not if there is already a layer mask and especially not if that mask is currently active.
Hm, I find the possibility to DND-create layers from any drawable quite useful. What about popping up a menu if more than one action is possible on the given drop destination? Also, layers can always be added to images of any size, while masks and channels need to be of the size of the layer/image they belong to. We'd need to auto-convert the dropped drawable in that cases. BTW, it could also behave differently if a layer/mask/whatever is dropped to another image's layers dialog. You even have control where to drop the layer, so why not allowing drops to the layer mask. Seems this needs more thinking... Anyway, this is IMHO a new feature and will only go in 1.3. I've set Severity and Target milestone accordingly.
I originally reported this as a bug against 1.2.3 because the behavior of drag-and-drop is inconsistent with the copy-and-paste behavior: as mentioned above, if you copy (Ctrl-C), paste (Ctrl-V) and anchor (Ctrl-H), then everything works: the mask is copied from one image to the other (including the optional clipping or size adjustment done when anchoring). But if you use drag-and-drop (which should be a shortcut for doing the same - at least that's how the users should perceive it) then it does not work and you get a new layer instead. I agree that it would be nice to give a choice to the user if multiple actions are possible for the destination. It would also be nice to be able to drop a layer in another image's layer dialog (which would be a bit tricky to do if the layer dialog is configured to auto-switch). But these new features are not really necessary to fix the bug: there could be some code that detects if a layer mask is active in the destination image. If there is one, then the dragged drawable should be dropped in the mask instead of creating a new layer. This would make drag-and-drop behave as copy-and-paste. I would prefer to keep this report open as a bug for 1.2.x and have a separate bug report for the additional features that you suggested.
Bumping a bunch of enhancement requests which will not be done by the feature freeze to Future. Dave.
Nobody ever said that DND should be a shortcut for copy and paste. It's different and doesn't need to do the same.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gimp/issues/24.