Bug 516006 - Creating text on a non-vector layer doesn't automatically enable editing
Summary: Creating text on a non-vector layer doesn't automatically enable editing
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Tool/Text (other bugs)
Version First Reported In: 6.0.0-beta1
Platform: Other Linux
: NOR minor
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-02-14 21:59 UTC by Vitamorus
Modified: 2026-04-09 10:08 UTC (History)
2 users (show)

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


Attachments
Adding text to paint layer vs vector layer. (514.34 KB, video/mp4)
2026-02-14 21:59 UTC, Vitamorus
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vitamorus 2026-02-14 21:59:16 UTC
Created attachment 189593 [details]
Adding text to paint layer vs vector layer.

SUMMARY
Minor inconsistency: when adding text to a vector layer, the text object will automatically get "activated" and the text highlighted. When adding text on a non-vector layer, a new vector layer is added and the text object added but not "activated". 

STEPS TO REPRODUCE
1. Create new document (with a paint/background layer)
2. Select the Text Tool and click to create new text object, automatically generating a vector layer with placeholder text.
3. Click and drag once more to create a new text object. A new text object is created as expected, this time automatically highlighting the text and enabling editing.

I've attached a video demonstrating the bug.
Comment 1 Victor Wren 2026-03-11 18:56:09 UTC
Bug is reproducible in 5.3 Beta 3 on Windows 10.
Comment 2 Bug Janitor Service 2026-03-18 16:11:01 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/2713
Comment 3 Dmitry Kazakov 2026-04-09 10:07:31 UTC
Git commit ce382c8dc11e5336b95fcad441865254b8d1cc30 by Dmitry Kazakov.
Committed on 09/04/2026 at 09:57.
Pushed by dkazakov into branch 'master'.

Fix the crash when trying to add a shape to a vector layer

Changing function signature from `KoShapeContainer *` to `KoShapeContainer **` is really dangerous. Some places called
this function with a null pointer, so the compiler couldn't catch
this change.

This patch reverts a portion of the previous commit, restoring
the old API with `KoShapeContainer *`, but just creating a parent
for the newly text shape manually with a `createParentForShapes()`
call. That ensures that we know the new parent long before the
controller's `addShape()` method is called.

M  +9    -9    libs/flake/KoShapeController.cpp
M  +2    -2    libs/flake/KoShapeController.h
M  +1    -4    libs/flake/tests/TestShapePainting.cpp
M  +1    -1    libs/flake/tools/KoPathTool.cpp
M  +1    -1    plugins/tools/defaulttool/defaulttool/DefaultTool.cpp
M  +14   -5    plugins/tools/svgtexttool/SvgCreateTextStrategy.cpp
M  +1    -1    plugins/tools/tool_knife/CutThroughShapeStrategy.cpp
M  +1    -1    plugins/tools/tool_knife/RemoveGutterStrategy.cpp

https://invent.kde.org/graphics/krita/-/commit/ce382c8dc11e5336b95fcad441865254b8d1cc30
Comment 4 Dmitry Kazakov 2026-04-09 10:07:34 UTC
Git commit a03e5d0367200e12243f37fce70eb14a37e932f5 by Dmitry Kazakov, on behalf of Luna Lovecraft.
Committed on 09/04/2026 at 09:02.
Pushed by dkazakov into branch 'master'.

Fix text not getting selected when created on a normal layer

M  +9    -9    libs/flake/KoShapeController.cpp
M  +2    -2    libs/flake/KoShapeController.h
M  +4    -1    libs/flake/tests/TestShapePainting.cpp
M  +1    -1    libs/flake/tools/KoPathTool.cpp
M  +1    -1    plugins/tools/defaulttool/defaulttool/DefaultTool.cpp
M  +7    -2    plugins/tools/svgtexttool/SvgCreateTextStrategy.cpp
M  +2    -1    plugins/tools/svgtexttool/SvgTextTool.cpp
M  +1    -1    plugins/tools/tool_knife/CutThroughShapeStrategy.cpp
M  +1    -1    plugins/tools/tool_knife/RemoveGutterStrategy.cpp

https://invent.kde.org/graphics/krita/-/commit/a03e5d0367200e12243f37fce70eb14a37e932f5
Comment 5 Dmitry Kazakov 2026-04-09 10:07:42 UTC
Git commit f729bb6cebcd38684ff28d02b37f52680d56fe80 by Dmitry Kazakov.
Committed on 09/04/2026 at 10:05.
Pushed by dkazakov into branch 'master'.

Remove commented out code

It seems like the idea was to deselect a text shape on pressing "Enter"
key, though it is currently impossible, because Enter key is now
processed by the text edit mode itself.

With this line present, activation of a layer (with a node-changed singal)
deselects all shapes, which is not very useful for the user.

M  +0    -3    plugins/tools/svgtexttool/SvgTextTool.cpp

https://invent.kde.org/graphics/krita/-/commit/f729bb6cebcd38684ff28d02b37f52680d56fe80
Comment 6 Dmitry Kazakov 2026-04-09 10:08:22 UTC
Git commit 805c7c4686a107cd0c479fa33c47241bb98f6434 by Dmitry Kazakov, on behalf of Luna Lovecraft.
Committed on 09/04/2026 at 10:08.
Pushed by dkazakov into branch 'krita/6.0'.

Fix text not getting selected when created on a normal layer

M  +9    -9    libs/flake/KoShapeController.cpp
M  +2    -2    libs/flake/KoShapeController.h
M  +4    -1    libs/flake/tests/TestShapePainting.cpp
M  +1    -1    libs/flake/tools/KoPathTool.cpp
M  +1    -1    plugins/tools/defaulttool/defaulttool/DefaultTool.cpp
M  +7    -2    plugins/tools/svgtexttool/SvgCreateTextStrategy.cpp
M  +2    -1    plugins/tools/svgtexttool/SvgTextTool.cpp
M  +1    -1    plugins/tools/tool_knife/CutThroughShapeStrategy.cpp
M  +1    -1    plugins/tools/tool_knife/RemoveGutterStrategy.cpp

https://invent.kde.org/graphics/krita/-/commit/805c7c4686a107cd0c479fa33c47241bb98f6434
Comment 7 Dmitry Kazakov 2026-04-09 10:08:24 UTC
Git commit f45b43133df6962d9a884a8e54ddef6f162588db by Dmitry Kazakov.
Committed on 09/04/2026 at 10:08.
Pushed by dkazakov into branch 'krita/6.0'.

Remove commented out code

It seems like the idea was to deselect a text shape on pressing "Enter"
key, though it is currently impossible, because Enter key is now
processed by the text edit mode itself.

With this line present, activation of a layer (with a node-changed singal)
deselects all shapes, which is not very useful for the user.

M  +0    -3    plugins/tools/svgtexttool/SvgTextTool.cpp

https://invent.kde.org/graphics/krita/-/commit/f45b43133df6962d9a884a8e54ddef6f162588db
Comment 8 Dmitry Kazakov 2026-04-09 10:08:30 UTC
Git commit 2d975fd8be2ff613b1066a205aa90aa5867f2fd6 by Dmitry Kazakov.
Committed on 09/04/2026 at 10:08.
Pushed by dkazakov into branch 'krita/6.0'.

Fix the crash when trying to add a shape to a vector layer

Changing function signature from `KoShapeContainer *` to `KoShapeContainer **` is really dangerous. Some places called
this function with a null pointer, so the compiler couldn't catch
this change.

This patch reverts a portion of the previous commit, restoring
the old API with `KoShapeContainer *`, but just creating a parent
for the newly text shape manually with a `createParentForShapes()`
call. That ensures that we know the new parent long before the
controller's `addShape()` method is called.

M  +9    -9    libs/flake/KoShapeController.cpp
M  +2    -2    libs/flake/KoShapeController.h
M  +1    -4    libs/flake/tests/TestShapePainting.cpp
M  +1    -1    libs/flake/tools/KoPathTool.cpp
M  +1    -1    plugins/tools/defaulttool/defaulttool/DefaultTool.cpp
M  +14   -5    plugins/tools/svgtexttool/SvgCreateTextStrategy.cpp
M  +1    -1    plugins/tools/tool_knife/CutThroughShapeStrategy.cpp
M  +1    -1    plugins/tools/tool_knife/RemoveGutterStrategy.cpp

https://invent.kde.org/graphics/krita/-/commit/2d975fd8be2ff613b1066a205aa90aa5867f2fd6