Layer doesn't switch when selecting multiple objects in another layer

Bug #168443 reported by Eric Jiang on 2007-03-05
This bug affects 6 people
Affects Status Importance Assigned to Milestone

Bug Description

My Diagnosis: If the user selects multiple objects in a layer that's not
the current one, Inkscape will not switch layers to the selection's layer
(even though they're all in one layer).

Solution: When selecting multiple objects, if all the objects are on the
same layer, then switch to that layer.

Exact steps to reproduce this problem:

1. Create two layers, one Top and one Bottom.
2. Lock and hide the Top layer (this might not be necessary).
3. Create a bunch of shapes on the bottom layer.
4. Make sure that the current layer (shown in the bottom little layer
selector) is Bottom.
5. Select some of the objects and Shift+PgUp to move them to Top. For
convenience, they will disappear since Top is hidden.
6. Watch the little bottom layer selector switch to "Top."
7. Now, select some more (multiple objects) of the Bottom layer by drag-selection, instead of shift-clicking. The layer
selector does not switch to Bottom when selecting multiple objects, even
though all of the objects are in the same layer (the status bar says so).
8. Shift+PgUp doesn't work, because the current layer is still on "Top,"
even though all the objects selected are on "Bottom."

This caused a minor inconvenience for me when I was moving many objects up
one layer, some at a time. They were all spread out, so I couldn't just
select them en masse and move them.

[Edit: Easier steps]
1. Create two layers, a "top" and a "bottom."
2. Create two objects in "bottom."
3. Select the top layer in the layer dialog box.
4. Drag-select the objects in the bottom layer.
5. Shift-PgUp does not work because Inkscape thinks it's still in the top layer.

Ryan Lerch (ryanlerch) wrote :

can you check this on a current development version of inkscape?

Changed in inkscape:
importance: Undecided → Medium
status: New → Incomplete
Eric Jiang (erjiang) wrote :

Still does this on 16 Jan 2008 build.

Tom Davidson (tjd-mit) wrote :

Mazin--thanks for the really detailed step-by-step instructions.
At step 7, the layer selector *does* switch back to 'bottom' for me, as soon as I click on the first remaining visible object, and so at step 8, I can move those objects up to the 'top' layer.

I'm running latest SVN (rev 17236) under Linux. What OS are you running? Can you try this again with today's build?

Eric Jiang (erjiang) wrote :

Yes, the bug is still present on the Feb 4 2008 Windows build.

The reason why your layer selector switches back to 'bottom,' Tom, is because you're selecting them one at a time. This was something that I didn't make clear; in step 7, you have to drag-select multiple objects at once. If multiple objects are selected at once, Inkscape won't switch layers, even if the multiple objects are all in the same layer.

description: updated

I've simplified the steps to reproduce this bug; they have been appended to the summary.

Tom Davidson (tjd-mit) wrote :

Thanks for the clarification Mazin. Confirmed in yesterday's SVN (rev 17236) under Linux, with Mazin's new instructions.

Changed in inkscape:
status: Incomplete → Confirmed
karamelin (karamelin) wrote :

[Edit: Easier steps]
5. Shift-PgUp does not work because Inkscape thinks it's still in the top layer.
6. Make active bottom layer with selected objects by clicking on its name in Layers Dialog.
7. Shift-PgUp still does not work.


su_v (suv-lp) wrote :

@karamelin - AFAICT your added steps are related to a different issue (mouse focus trapped in docked dialog causes keyboard shortcuts to fail, see bug #666512 and underlying issue reported in bug #201203).

If you click again on the selected objects on-canvas after having clicked on the 'bottom' layer in the layer dialog (to return the focus to the canvas), 'Shift-PgUp' works as expected.

su_v (suv-lp) on 2013-03-19
tags: added: selection
LucaDC (dicappello) wrote :

Please, before considering this a bug think that it's only a special case of drag-selecting many objects.
I think that the current behavior is correct and I actually take advantage of it for quickly moving objects between layers:
 - select the layer you want to move the objects to;
 - drag select even a single object;
 - ctrl-x -> ctrl-alt-v;
 - repeat...
The layer remains the target one and you can selectively choose the objects you need to move between all existing in all layers or even move a lot of objects with a single operation. I've moved fast hundreds of (usually small) objects in this way.

I wouldn't add a special handling of a well defined behavior: if you click-select a single object the layer is switched, if you drag select it's not.
IMHO, click-selecting and drag-selecting are two different operations, being the second a more general one and this justifies the different results in layer switching.

LucaDC (dicappello) wrote :

Of course the problem of moving different selected objects correctly is a different matter and should be fixed. But I don't think that changing the selected layer is the right way to do it, as it should work also when all objects are not on the same layer.

The real problem here is that Inkscape's move-between-layers (Shift+PageDown/PageUp) code doesn't know how to handle multiple layers, so it instead looks at the "current layer", which has nothing to do with the objects. Having a special case for drag-selecting objects in a single layer WON'T fix the bug.

Consider having three layers: one object in the top and one object in the middle. Drag selecting and Shift+PageDown with the current layer as the bottom layer won't work, even though both objects can freely move downwards. But what should the correct behavior be?

Option 1: individually move each object down a single layer. This is probably the "correct" technical solution, but it's not useful.
Option 2: move each object *to* a single layer upwards/downwards. This is probably universally the desired behavior. However, which layer should it choose?

Beluga (buovjaga) wrote :

Drag selection now switches layer focus.

Arch Linux 64-bit, KDE Plasma 5
Inkscape 0.92pre1 15054 (GTK3)

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers