<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>398814</bug_id>
          
          <creation_ts>2018-09-18 18:32:24 +0000</creation_ts>
          <short_desc>lose previously selected layer on undo of flatten image</short_desc>
          <delta_ts>2018-09-24 07:25:11 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>krita</product>
          <component>Layer Stack</component>
          <version>4.1.1</version>
          <rep_platform>Arch Linux</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>wkg28406</reporter>
          <assigned_to name="Krita Bugs">krita-bugs-null</assigned_to>
          <cc>halla</cc>
          
          <cf_commitlink>https://commits.kde.org/krita/9e6e3edcbbaf7ac2c9d8ad1fa9a3c886e2be27f1</cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1781914</commentid>
    <comment_count>0</comment_count>
    <who name="">wkg28406</who>
    <bug_when>2018-09-18 18:32:24 +0000</bug_when>
    <thetext>Krita 4.1.1-4 (Arch Linux)

Tested with fresh configuration (removing existing ~/.local/share/krita, ~/.config/krita*)

Reproducible: Always

Steps:
1. Create new document (ctrl+n)
2. Layer &gt; Flatten Image (ctrl+shift+e)
3. Undo (ctrl+z)

Results:
No layer selected, unable to perform action until manually select in layer docker.

Expected:
Previously selected layer, in this case Layer 2, selected and active.

Likely happens because new layer is created called &quot;root Merged&quot;, thus when undone no longer has reference. This does not happen with normal merges (ctrl+e).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1783518</commentid>
    <comment_count>1</comment_count>
    <who name="Dmitry Kazakov">dimula73</who>
    <bug_when>2018-09-20 17:34:12 +0000</bug_when>
    <thetext>Git commit 8564a3a47e7813ca6ade09a680b19f1c1cddd4fa by Dmitry Kazakov.
Committed on 20/09/2018 at 17:08.
Pushed by dkazakov into branch &apos;master&apos;.

Fix selecting of the layer after undoing Flatten Image

M  +2    -2    libs/image/kis_image.cc
M  +1    -1    libs/image/kis_image.h
M  +7    -2    libs/image/kis_layer_utils.cpp
M  +1    -1    libs/image/kis_layer_utils.h
M  +1    -1    libs/image/tests/kis_image_test.cpp
M  +1    -1    libs/libkis/Document.cpp
M  +1    -1    libs/ui/kis_layer_manager.cc
M  +1    -1    libs/ui/tests/kis_dummies_facade_base_test.cpp
M  +1    -1    libs/ui/tests/kis_node_model_test.cpp
M  +1    -1    plugins/extensions/separate_channels/kis_channel_separator.cc

https://commits.kde.org/krita/8564a3a47e7813ca6ade09a680b19f1c1cddd4fa</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1786246</commentid>
    <comment_count>2</comment_count>
    <who name="Halla Rempt">halla</who>
    <bug_when>2018-09-24 07:25:11 +0000</bug_when>
    <thetext>Git commit 9e6e3edcbbaf7ac2c9d8ad1fa9a3c886e2be27f1 by Boudewijn Rempt, on behalf of Dmitry Kazakov.
Committed on 24/09/2018 at 07:05.
Pushed by rempt into branch &apos;krita/4.1&apos;.

Fix selecting of the layer after undoing Flatten Image

M  +2    -2    libs/image/kis_image.cc
M  +1    -1    libs/image/kis_image.h
M  +7    -2    libs/image/kis_layer_utils.cpp
M  +1    -1    libs/image/kis_layer_utils.h
M  +1    -1    libs/image/tests/kis_image_test.cpp
M  +1    -1    libs/libkis/Document.cpp
M  +1    -1    libs/ui/kis_layer_manager.cc
M  +1    -1    libs/ui/tests/kis_dummies_facade_base_test.cpp
M  +1    -1    libs/ui/tests/kis_node_model_test.cpp
M  +1    -1    plugins/extensions/separate_channels/kis_channel_separator.cc

https://commits.kde.org/krita/9e6e3edcbbaf7ac2c9d8ad1fa9a3c886e2be27f1</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>