Bug 510215 - Qt6 break shift-click selection of contiguous layers
Summary: Qt6 break shift-click selection of contiguous layers
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: * Unknown (other bugs)
Version First Reported In: git master (please specify the git hash!)
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-10-04 01:41 UTC by Ming Chuan
Modified: 2025-12-25 14:50 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ming Chuan 2025-10-04 01:41:06 UTC
SUMMARY

See https://docs.krita.org/en/reference_manual/dockers/layers.html#hot-keys-and-sticky-keys , hold down shift key should select multiple contiguous layers.

I tested the following scenarios, and it seems like this feature is mostly likely broken by Qt6

* Qt6 git master source build, run with XWayland -> doesn't work
* Qt6 git master source build, runing natively in wayland -> doesn't work
* Qt5 5.2.13 source build, XWayland -> works
* latest krita qt5 appimage, XWayland -> works
* latest krita qt6 appimage -> due to unrelated issue, I'm unable test it


STEPS TO REPRODUCE
1. Create multiple layers
2. Single click on one of the layer to select it
3. Hold shift, click on another layer

OBSERVED RESULT

All layers in between them should be selected

EXPECTED RESULT


SOFTWARE/OS VERSIONS
Qt 6.9.2

ADDITIONAL INFORMATION
Comment 1 Halla Rempt 2025-11-14 11:33:23 UTC
I cannot reproduce with either master or 5.2 on my m1 with a wacom cintiq tablet.
Comment 2 Wolfgang Baer 2025-11-14 17:52:57 UTC
I tested with Krita 5.3, Windows 11, Huion tablet.

If layers are empty, shift click works as expected (all layers inbetween get selected).
If layers contain pixels (e.g. a brush stroke), shift click does not work as expected. Instead of selecting all layers inbetween only the last clicked layer gets selected.
Comment 3 Halla Rempt 2025-11-15 08:13:15 UTC
I tried that too, but I still cannot reproduce with 5.2.13 on MacOS and a cintiq tablet. That makes it sound like it's different for different types of tablets...
Comment 4 Ming Chuan 2025-11-15 14:11:52 UTC
> If layers contain pixels (e.g. a brush stroke), shift click does not work as expected. Instead of selecting all layers inbetween only the last clicked layer gets selected.

That's wild, on X11/XWayland it works regardless of whether the paint layers has any pixels

> I cannot reproduce with either master or 5.2 on my m1 with a wacom cintiq tablet.

Did you build master with qt5 or qt6. How about qt6 appimage?

I looked into the code and find that
* The multi-select bug is caused by the (ctrl drag&drop) hacks in `NodeView::selectionCommand` , which overrides the shift multiselect behavior (perhaps in a nondeterministic way).
* It seems like the feature that the workaround is for (ctrl-dragging&dropping) is already not 100% working when multiple layers is selected. I attempted to fix it but I think it'll need some good understanding of the qt list.. After all, it feels krita is trying to support many kinds intricate actions in the layers docker that's perhaps beyond what the qt's list view is designed for
Comment 5 Halla Rempt 2025-11-16 14:08:20 UTC
These are all Qt5 builds: I haven't succeeded in building against Qt6 on macOS yet.
Comment 6 Ming Chuan 2025-11-25 03:31:45 UTC
(Another issue that's probably specific to wayland: when the CPU is busy, krita's keyboard event loop probably got somehow stuck, and ctrl-select randomly stops working and becomes normal select)
Comment 7 Dmitry Kazakov 2025-12-25 14:50:23 UTC
Git commit d3eaaf15976380a5df6370dfa9ccd7f5b281f34f by Dmitry Kazakov, on behalf of Luna Lovecraft.
Committed on 25/12/2025 at 14:50.
Pushed by dkazakov into branch 'master'.

Fix shift click selection not working in Qt6

Fixed shift click layer selection not working in Qt6, 
by removing a custom `selectCommand` function from `NodeView`.

Those workarounds don't seem to be necessary anymore as all the related
bugs have been fixed in the newer Qt versions. And now the only thing
it's doing is breaking the Qt6 version.

M  +0    -55   plugins/dockers/layerdocker/NodeView.cpp
M  +0    -3    plugins/dockers/layerdocker/NodeView.h

https://invent.kde.org/graphics/krita/-/commit/d3eaaf15976380a5df6370dfa9ccd7f5b281f34f