Bug 453478 - Activate the top layer after outputting multiple layers with G'MIC
Summary: Activate the top layer after outputting multiple layers with G'MIC
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: G'Mic for Krita (show other bugs)
Version: git master (please specify the git hash!)
Platform: Compiled Sources Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: amyspark
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-06 21:35 UTC by amyspark
Modified: 2022-06-08 16:55 UTC (History)
3 users (show)

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


Attachments
Undo G'MIC filter active layer (5.94 KB, image/png)
2022-05-06 21:35 UTC, amyspark
Details
gif (110.92 KB, image/gif)
2022-05-07 01:13 UTC, thetwo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description amyspark 2022-05-06 21:35:31 UTC
Created attachment 148616 [details]
Undo G'MIC filter active layer

SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***
This is a self filed bug report to acknowledge TheTwo's bug in https://invent.kde.org/graphics/krita/-/merge_requests/1428.

> When I perform the undo operation, it will not make the original layer become the active layer, but the one below. This is inconvenient. Is there any way to correct it?

STEPS TO REPRODUCE
1. 
2. 
3. 

OBSERVED RESULT


EXPECTED RESULT


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 thetwo 2022-05-07 01:13:57 UTC
Created attachment 148624 [details]
gif

I made a gif to illustrate it.
Maybe I've discovered why: when gmic outputs multiple layers, the first layer is converted from the original layer and the following layers are added (which would explain why only one layer doesn't have position problems)
If you activate the top layer after using the filter, it will be activated when undo
So the question should be changed to "Activate the top layer after outputting multiple layers with gmic"
Comment 2 amyspark 2022-05-16 21:43:45 UTC
> Maybe I've discovered why: when gmic outputs multiple layers, the first layer is converted from the original layer and the following layers are added (which would explain why only one layer doesn't have position problems)

I should probably dig into this, reusing a layer should re-set its properties; but first, cc Dmitry: do we have a way to set a given layer as current from code?
Comment 3 Bug Janitor Service 2022-05-31 04:35:45 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 4 amyspark 2022-06-02 22:32:51 UTC
Assigning to myself. Let's see what I can do.
Comment 5 Bug Janitor Service 2022-06-02 23:56:59 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/1465
Comment 6 amyspark 2022-06-08 16:53:33 UTC
Git commit 9bb3751ee8bf95774eb4e43e45c506b9a8fd1f45 by L. E. Segovia.
Committed on 08/06/2022 at 16:52.
Pushed by lsegovia into branch 'master'.

G'MIC: Activate the newest added layer

M  +62   -3    plugins/extensions/qmic/kis_qmic_synchronize_layers_command.cpp

https://invent.kde.org/graphics/krita/commit/9bb3751ee8bf95774eb4e43e45c506b9a8fd1f45
Comment 7 amyspark 2022-06-08 16:55:38 UTC
Git commit 885f08efb8a41fb3441179a916844fcf68479289 by L. E. Segovia.
Committed on 08/06/2022 at 16:54.
Pushed by lsegovia into branch 'krita/5.1'.

G'MIC: Activate the newest added layer
(cherry picked from commit 9bb3751ee8bf95774eb4e43e45c506b9a8fd1f45)

M  +62   -3    plugins/extensions/qmic/kis_qmic_synchronize_layers_command.cpp

https://invent.kde.org/graphics/krita/commit/885f08efb8a41fb3441179a916844fcf68479289