Bug 401656 - "Arrange" docker not working in nightly Krita?
Summary: "Arrange" docker not working in nightly Krita?
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Dockers (other bugs)
Version First Reported In: git master (please specify the git hash!)
Platform: Appimage Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-02 15:49 UTC by mvowada
Modified: 2019-08-03 14:50 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.2.3
Sentry Crash Report:


Attachments
(Video) (330.23 KB, video/mp4)
2018-12-02 15:49 UTC, mvowada
Details
(New video) (706.14 KB, video/mp4)
2018-12-10 02:25 UTC, mvowada
Details
KRA file for testing (63.36 KB, application/x-krita)
2018-12-14 20:38 UTC, Anna Medonosova
Details
a backtrace of the second run of DefaultTool::updateActions() (43.77 KB, text/plain)
2018-12-14 20:39 UTC, Anna Medonosova
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mvowada 2018-12-02 15:49:14 UTC
Created attachment 116624 [details]
(Video)

(Tested with Krita 4.2.0-pre-alpha (git 4fb7b5b) on Ubuntu 14.04)

It seems that the "Arrange" docker doesn't work in latest nightly build (see video):

    1. fresh configs
    2. select 2 shapes
    3. try to align them.

Actual Results: nothing happens.
Expected Results: align the shapes.

Note: it worked well after commit https://cgit.kde.org/krita.git/commit/?id=cdc608d37ade87ed6ce45119d9352af9c8bab4ce
Comment 1 mvowada 2018-12-04 08:57:31 UTC
Sorry, I have just re-checked and now it works well. Probably there were too many applications open the first time. I apologize for the confusion. (krita-4.2.0-pre-alpha-4fb7b5b-x86_64.appimage)
Comment 2 mvowada 2018-12-10 02:25:04 UTC
Created attachment 116822 [details]
(New video)

I've finally found that it happens only with objects coming from layers that have been duplicated, while the "Select Shapes Tool" was active/selected (see new video).

The exact steps are:

    1. CTRL + N (create new)
    2. create some vectors on 1 layer
    3. switch to the "Select Shapes Tool" (important!)
    4. duplicate the vector layer.

Actual Results: it won't be possible to arrange the duplicated objects.
Comment 3 mvowada 2018-12-10 02:26:01 UTC
Reopening...
Comment 4 Anna Medonosova 2018-12-14 20:38:24 UTC
I have reproduced the issue. Another way to reproduce is to:

1, create a file with a vector layer, two shapes
2, save and close the file
3, reopen the file
4, try to align the shapes
5, nothing happens.

I'm attaching my testing file to this bug.

The bug is not specific to the Arrange docker. The right-click context menu is also affected.


I have run it in GDB, here is what I have seen:

After selecting my two shapes in Krita, the following function (in DefaultTool.cpp:1573) is triggered:

void DefaultTool::updateActions()
{
    QList<KoShape*> editableShapes;

    if (koSelection()) {
        editableShapes = koSelection()->selectedEditableShapes();
    }
[ ... code that enables/disables arrange actions ... ]

It runs two times. Usually the first time it calls DefaultTool::koSelection, which returns two entries for editableShapes and therefore the arrange actions are enabled.

The second time, ToolReferenceImages::koSelection() is called instead, editableShapes are therefore empty and the arrange actions are disabled.
Comment 5 Anna Medonosova 2018-12-14 20:38:59 UTC
Created attachment 116925 [details]
KRA file for testing
Comment 6 Anna Medonosova 2018-12-14 20:39:45 UTC
Created attachment 116926 [details]
a backtrace of the second run of DefaultTool::updateActions()
Comment 7 Anna Medonosova 2018-12-19 13:08:38 UTC
Git commit 325cbf6c62d3d83fc7929f0eddd8313429030214 by Anna Medonosova.
Committed on 19/12/2018 at 13:08.
Pushed by amedonosova into branch 'master'.

Partial fix for bug 401656

Summary:
Only Default Tool should connect to the selectedShapesProxy::selectionChanged,
otherwise arrange actions (both in context menu and arrange docker) get disabled
errorneusly.

This fixes just one part of the bug. The issue with disabled arrange
actions after layer duplication is still present.

Reviewers: #krita, rempt

Reviewed By: #krita, rempt

Tags: #krita

Differential Revision: https://phabricator.kde.org/D17665

M  +4    -2    plugins/tools/defaulttool/defaulttool/DefaultTool.cpp
M  +1    -1    plugins/tools/defaulttool/defaulttool/DefaultTool.h
M  +1    -1    plugins/tools/defaulttool/defaulttool/DefaultToolFactory.cpp
M  +1    -1    plugins/tools/defaulttool/referenceimagestool/ToolReferenceImages.cpp

https://commits.kde.org/krita/325cbf6c62d3d83fc7929f0eddd8313429030214
Comment 8 Anna Medonosova 2018-12-19 18:30:32 UTC
The issue with duplicate layer is still present. From what I have seen in the debugger, after I duplicate the layer, KoSelection stops emitting the selectionChanged signal. If I switch to another layer and back, it starts sending the signal again, if I switch to another tool and back, it also starts sending the signal.
Comment 9 Anna Medonosova 2019-07-16 04:02:17 UTC
With latest git master/appimage I cannot reproduce this bug anymore. Please, mvowada, can you confirm that it is indeed working now?
Comment 10 Scott Petrovic 2019-07-25 12:35:34 UTC
I also cannot reproduce with the Krita 4.2.3. I thought there were some fixes Dmitry did somewhat recently with fixing some of the signals and connections when duplicating vector shapes.

I am going to switch this back to needs info for now.
Comment 11 mvowada 2019-07-29 10:20:50 UTC
(In reply to Anna Medonosova from comment #9)
> With latest git master/appimage I cannot reproduce this bug anymore. Please,
> mvowada, can you confirm that it is indeed working now?

Hi Anna, I'm sorry but I'm not able to try with a more recent version of Krita since the appimage now uses Qt 5.12 and it won't start on my old OS. If the bug is fixed now, please, feel free to close this ticket. Thanks
Comment 12 Bug Janitor Service 2019-07-30 04:33:12 UTC
Thanks for your comment!

Automatically switching the status of this bug to REPORTED so that the KDE team
knows that the bug is ready to get confirmed.

In the future you may also do this yourself when providing needed information.
Comment 13 Anna Medonosova 2019-08-03 14:50:02 UTC
All issues from this bug are fixed now.