After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 637313 - Should be possible to copy/paste whole layers in a single step
Should be possible to copy/paste whole layers in a single step
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: User Interface
2.6.8
Other All
: Normal normal
: 2.10
Assigned To: GIMP Bugs
GIMP Bugs
: 693208 694618 701263 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-12-15 15:27 UTC by Federico Mena Quintero
Modified: 2016-09-19 22:35 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Federico Mena Quintero 2010-12-15 15:27:08 UTC
I just discovered that one can drag a layer from the layers dialog into another image window.  This will create a copy of the layer in that other image.  This is very nice, but if the original layer was called "Foo", then the copied layer is now called "Foo copy".  It is inconvenient that you have to rename the layer back to "Foo", especially as you can't just hit F2 in the layers dialog to edit a layer's name (you have to right-click and find the "Edit layer attributes" option in the busy menu you get).

I discovered that drag operation by accident.  Initially I looked for a "Copy layer to clipboard" command or something similar.  There isn't one, so I simply switched to the layer, hit Select All, Copy, and then Paste in the destination image.  This of course creates a floating selection, which I then need to anchor and rename - which is pretty cumbersome.

A "Copy layer" command would be very useful.
Comment 1 Michael Natterer 2011-02-14 18:30:14 UTC
You can double click the layer name. I use F2 myself in nautilus,
is this some kind of standard? It's trivial to add a binding signal
for that in GIMP.

Also, I recently got rid of some of our default names for new
object (wihch seem to be from the stone age). Maybe "foo copy"
should die too.

But anyway, in order to really add a copy/paste layer feature
we'd have to run it through the ui dpt -> enhancement.
Comment 2 Michael Natterer 2011-02-14 19:02:52 UTC
There you go with a small improvement:

commit 95f14f5de86cf07ae14ba27807b71e9841a14978
Author: Michael Natterer <mitch@gimp.org>
Date:   Mon Feb 14 20:01:08 2011 +0100

    app: add an "edit-name" binding signal and default to F2

 app/widgets/gimpcontainertreeview.c |   70 +++++++++++++++++++++++++++++++++++
 app/widgets/gimpcontainertreeview.h |    6 +++
 2 files changed, 76 insertions(+), 0 deletions(-)
Comment 3 Federico Mena Quintero 2011-02-21 04:40:19 UTC
Thanks, having F2 available will be very handy!

I do look forward to having a Copy Layer command :)
Comment 4 Michael Schumacher 2013-02-06 01:40:05 UTC
*** Bug 693208 has been marked as a duplicate of this bug. ***
Comment 5 Michael Natterer 2013-02-25 22:00:46 UTC
This it not only an issue about the layer name, it's also about layer
groups, text layers and whatever future layer types. It should be possible
to copy/paste them completely, with all information intact. Not too hard
to implement either.
Comment 6 Michael Natterer 2013-02-25 22:01:37 UTC
*** Bug 694618 has been marked as a duplicate of this bug. ***
Comment 7 Michael Natterer 2013-02-25 22:02:46 UTC
This is actually bad enough to count as bug, not enhancement.
Comment 8 Michael Schumacher 2013-05-30 21:46:32 UTC
*** Bug 701263 has been marked as a duplicate of this bug. ***
Comment 9 Michael Natterer 2013-05-30 22:26:58 UTC
*** Bug 701263 has been marked as a duplicate of this bug. ***
Comment 10 Michael Natterer 2016-09-19 22:35:30 UTC
Fixed in master:

commit 67863dabf92e45ac5bda18c814e893f55d62cc9a
Author: Michael Natterer <mitch@gimp.org>
Date:   Mon Sep 19 23:53:40 2016 +0200

    Bug 637313 - Should be possible to copy/paste whole layers in a single step
    
    Use the newly added clipboard for entire images to copy/paste layers
    (we only create single-layer clipboard images, and use only the first
    layer of any recieved image, the layers can be arbitrarily complex
    though):
    
    - change gimp_edit_copy,cut,paste() to return/take a GimpObject
      that can be a GimpImage or GimpBuffer
    - cut/copy the whole layer if there is no selection
    - always paste layers as new layers, not floating selections
    - always paste news layers on top of the active layer, where
      we would attach a floating selection
    - add enum GimpPasteType { FLOATING, FLOATING_INTO, NEW_LAYER }
    - add GimpPasteType parameter to gimp_edit_paste() and handle all
      three cases there because there is now a lot of common code
      involved
    - change all callers accordingly, use only legacy buffer pasting
      from the PDB for now

 app/actions/buffers-commands.c     |  11 +-
 app/actions/edit-commands.c        | 291 ++++++++++++++++++++++-------------------------
 app/core/core-enums.c              |  31 +++++
 app/core/core-enums.h              |  12 ++
 app/core/gimp-edit.c               | 180 ++++++++++++++++++++---------
 app/core/gimp-edit.h               |   8 +-
 app/display/gimpdisplayshell-dnd.c |  24 ++--
 app/pdb/edit-cmds.c                |  14 ++-
 tools/pdbgen/pdb/edit.pdb          |  14 ++-
 9 files changed, 348 insertions(+), 237 deletions(-)