<?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>473719</bug_id>
          
          <creation_ts>2023-08-24 11:23:23 +0000</creation_ts>
          <short_desc>When activating some tools, actions are always enabled at first</short_desc>
          <delta_ts>2023-08-29 09:07:39 +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</component>
          <version>git master (please specify the git hash!)</version>
          <rep_platform>Microsoft Windows</rep_platform>
          <op_sys>Microsoft Windows</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>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Alvin Wong">alvin</reporter>
          <assigned_to name="Dmitry Kazakov">dimula73</assigned_to>
          <cc>dimula73</cc>
          
          <cf_commitlink>https://invent.kde.org/graphics/krita/-/commit/087c9ef921bc70e5bee9ddc646ba4d34ad153e89</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>2248424</commentid>
    <comment_count>0</comment_count>
    <who name="Alvin Wong">alvin</who>
    <bug_when>2023-08-24 11:23:23 +0000</bug_when>
    <thetext>SUMMARY
When activating the Select Shapes Tool (DefaultTool) or the reference image tool, the actions in the context menu are always enabled at first, before the current selection has changed.

STEPS TO REPRODUCE
1. Create a text shape
2. Switch back to DefaultTool
3. Right click on canvas

OBSERVED RESULT
Most actions are enabled when they shouldn&apos;t be, some (e.g. Group, Ungroup) should not be visible at all.

EXPECTED RESULT
Some actions should not be enabled when no shapes are selected. Group and ungroup actions should not be visible when only one shape is selected and that shape is not ungroupable.

SOFTWARE/OS VERSIONS
Windows: 10

ADDITIONAL INFORMATION
For DefaultTool, the actions are disabled in DefaultTool::updateDistinctiveActions, called from DefaultTool::updateActions, which is called from DefaultTool::activate, but they are then being re-enabled in CanvasData::activateToolActions (KoToolManager.cpp:106), called from KoToolManager::Private::postSwitchTool.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2249241</commentid>
    <comment_count>1</comment_count>
    <who name="Dmitry Kazakov">dimula73</who>
    <bug_when>2023-08-29 09:07:23 +0000</bug_when>
    <thetext>Git commit c4c0d1a02fb9a2e273c9b4ee67d72821464f4861 by Dmitry Kazakov.
Committed on 29/08/2023 at 11:07.
Pushed by dkazakov into branch &apos;krita/5.2&apos;.

Fix &apos;enabled&apos; state of the actions in the Default Tool

The tool manager enables all the actions unconditionally, we should
do that **before** actually calling the tool&apos;s activate method.

M  +16   -2    libs/flake/KoToolManager.cpp

https://invent.kde.org/graphics/krita/-/commit/c4c0d1a02fb9a2e273c9b4ee67d72821464f4861</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2249242</commentid>
    <comment_count>2</comment_count>
    <who name="Dmitry Kazakov">dimula73</who>
    <bug_when>2023-08-29 09:07:39 +0000</bug_when>
    <thetext>Git commit 087c9ef921bc70e5bee9ddc646ba4d34ad153e89 by Dmitry Kazakov.
Committed on 29/08/2023 at 11:07.
Pushed by dkazakov into branch &apos;master&apos;.

Fix &apos;enabled&apos; state of the actions in the Default Tool

The tool manager enables all the actions unconditionally, we should
do that **before** actually calling the tool&apos;s activate method.

M  +16   -2    libs/flake/KoToolManager.cpp

https://invent.kde.org/graphics/krita/-/commit/087c9ef921bc70e5bee9ddc646ba4d34ad153e89</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>