<?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>450577</bug_id>
          
          <creation_ts>2022-02-19 16:17:24 +0000</creation_ts>
          <short_desc>Contiguous Selection Tool Hangs when double clicking on large canvas</short_desc>
          <delta_ts>2022-07-19 13:48:37 +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>Tools/Selection</component>
          <version>5.0.2</version>
          <rep_platform>Appimage</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>regression, triaged</keywords>
          <priority>NOR</priority>
          <bug_severity>crash</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Andrea Montagna">fullmontis</reporter>
          <assigned_to name="Dmitry Kazakov">dimula73</assigned_to>
          <cc>acc4commissions</cc>
    
    <cc>dimula73</cc>
    
    <cc>halla</cc>
    
    <cc>tomtomtomreportingin</cc>
          
          <cf_commitlink>https://invent.kde.org/graphics/krita/commit/295a63340397962446282a684c1f94b7385d17d2</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>2106424</commentid>
    <comment_count>0</comment_count>
    <who name="Andrea Montagna">fullmontis</who>
    <bug_when>2022-02-19 16:17:24 +0000</bug_when>
    <thetext>SUMMARY

The Contiguous Selection Tool hangs Krita when double clicking on the canvas. By double clicking I mean clicking before the previous Contiguous Selection operation has concluded. If I only click once, the selection is completed correctly without issues. 

This only seems to be reproducible for me on large enough canvases in which the selection operation is not instantaneous, so this may depend on the system specs. It was reproducible for me down to a 1000x1000 canvas if I double click fast enough, but I also have a rather low end CPU (Ryzen 1300)

STEPS TO REPRODUCE
1. Open large enough empty canvas (2000x2000 or more)
2. Select Contiguous Selection Tool and Double click on canvas 

OBSERVED RESULT

Krita hangs and one core of the CPU is fully maxed until Krita is killed. Any other operation hangs, and trying to save the file opens the Continue/Stop operation and save/Close dialogue, but clicking on any button has no effect. The only way to resume work on krita is killing the window and opening a new session.

EXPECTED RESULT

The canvas is completely selected and the program resumes normal function

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Xubuntu 20.04.3 LTS
Qt Version: qt5-default 5.12.8+dfsg-0ubuntu2.1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2109130</commentid>
    <comment_count>1</comment_count>
    <who name="Halla Rempt">halla</who>
    <bug_when>2022-03-03 13:47:03 +0000</bug_when>
    <thetext>I&apos;ve tried really hard, but either my pc is just too fast, or there&apos;s something else to it...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2116589</commentid>
    <comment_count>2</comment_count>
    <who name="Andrea Montagna">fullmontis</who>
    <bug_when>2022-04-10 11:28:08 +0000</bug_when>
    <thetext>I have made a video where I show the bug in action. I am using a rather recent Krita Plus version, krita-5.0.2-alpha-6edabfa864-x86_64.appimage, downloaded from the website.

https://www.youtube.com/watch?v=9GgqJ3q_c6Y</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2116599</commentid>
    <comment_count>3</comment_count>
    <who name="Andrea Montagna">fullmontis</who>
    <bug_when>2022-04-10 12:15:35 +0000</bug_when>
    <thetext>I forgot to also add the console output when the program gets stuck:

SAFE ASSERT (krita): &quot;(0)&quot; in file /home/appimage/workspace/Krita_Stable_Appimage_Build/krita/libs/image/floodfill/kis_fill_interval_map.cpp, line 87</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2116683</commentid>
    <comment_count>4</comment_count>
    <who name="">acc4commissions</who>
    <bug_when>2022-04-11 01:51:58 +0000</bug_when>
    <thetext>I have this problem too. The cpu doesn&apos;t maxed in my case, but the krita is stuck in &apos;Waiting for image operation to complete&apos; and I can&apos;t do anything(even including closing krita) until krita is killed. I can&apos;t cancel the operation either.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2138450</commentid>
    <comment_count>5</comment_count>
    <who name="">tomtomtomreportingin</who>
    <bug_when>2022-07-12 11:42:53 +0000</bug_when>
    <thetext>I can confirm this in 5.1.0 git 28311ea. It ONLY occurs when the &quot;Reference&quot; option is set to merged copy of all layers.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2138455</commentid>
    <comment_count>6</comment_count>
    <who name="">tomtomtomreportingin</who>
    <bug_when>2022-07-12 11:56:30 +0000</bug_when>
    <thetext>I can&apos;t reproduce this in 4.4.8 but I can reproduce it in 5.0.0 (with the &quot;All Layers&quot; setting) so it seems to be a regression of Krita 5.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2140131</commentid>
    <comment_count>7</comment_count>
    <who name="Dmitry Kazakov">dimula73</who>
    <bug_when>2022-07-19 13:18:39 +0000</bug_when>
    <thetext>Upgrading the bug to &quot;crash&quot;, because Krita becomes unusable after the bug manifests itself.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2140134</commentid>
    <comment_count>8</comment_count>
    <who name="Dmitry Kazakov">dimula73</who>
    <bug_when>2022-07-19 13:48:36 +0000</bug_when>
    <thetext>Git commit 7549b4ec3156a0174a4912509257d3dac094600b by Dmitry Kazakov.
Committed on 19/07/2022 at 13:48.
Pushed by dkazakov into branch &apos;krita/5.1&apos;.

Fix a hangup when double-clicking with Flood Selection Tool

Since fill command may read from the merged image, it should wait
until the entire image completes its updates, therefore the job
type shoudl be &apos;barrier&apos;.

M  +1    -1    plugins/tools/selectiontools/kis_tool_select_contiguous.cc

https://invent.kde.org/graphics/krita/commit/7549b4ec3156a0174a4912509257d3dac094600b</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2140135</commentid>
    <comment_count>9</comment_count>
    <who name="Dmitry Kazakov">dimula73</who>
    <bug_when>2022-07-19 13:48:37 +0000</bug_when>
    <thetext>Git commit 295a63340397962446282a684c1f94b7385d17d2 by Dmitry Kazakov.
Committed on 19/07/2022 at 13:48.
Pushed by dkazakov into branch &apos;master&apos;.

Fix a hangup when double-clicking with Flood Selection Tool

Since fill command may read from the merged image, it should wait
until the entire image completes its updates, therefore the job
type shoudl be &apos;barrier&apos;.

M  +1    -1    plugins/tools/selectiontools/kis_tool_select_contiguous.cc

https://invent.kde.org/graphics/krita/commit/295a63340397962446282a684c1f94b7385d17d2</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>