Bug 477715 - [Selection tools] Tracing interupted by Krita while using Recorder docker (and recording)
Summary: [Selection tools] Tracing interupted by Krita while using Recorder docker (an...
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Dockers/Recorder (show other bugs)
Version: nightly build (please specify the git hash!)
Platform: Appimage Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-29 12:36 UTC by David REVOY
Modified: 2024-11-08 12:57 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David REVOY 2023-11-29 12:36:47 UTC
Hi,

This bug is similar to https://bugs.kde.org/show_bug.cgi?id=474525 ( [Selection tools] Tracing interupted by Krita when an Overview Docker refreshes, RESOLVED/FIXED ), while tracing a selection the action to end the selection happens in the middle, even if the user doesn't wants it. But this time, the condition to interupt tracing selection on the canvas midway is the Recorder Docker while recording. 

STEPS TO REPRODUCE
1. On a large multilayered Krita document, activate the Recorder docker so it records frames in background.
2. Select the Freehand Selection Tool. 
3. Duplicate a layer with content on it
4. Immediately on the canvas, try to trace a large selection on the canvas

OBSERVED RESULT
Your selection will be interupted: an event in background on Krita during your tracing will end your selection: the current position will be connected to the origin of your selection as if you released your Mouse button or stylus.
You can also reproduce with painting or anything that update the canvas and force the Recorder to export a new frame. You'll notice it especially if you use a keyboard shortcut to switch to a selection tool; as you'll be quick enough to start tracing selection before any "Projection of the Recorder" update/refresh.  I just found for my "How to reproduce" example easier to use the duplicate layer while having already selected the Freehand Selection Tool to showcase the bug.

EXPECTED RESULT
Finishing the tracing of my selection.

OBSERVATIONS
- Can't reproduce when recording is off.
- The bug was discovered by Aqao on K-A (thanks for the report) I'm relaying here because I could reproduce. You'll find video screenshot on this K-A thread: https://krita-artists.org/t/recorder-cause-selection-tools-break-off/78976/1 

Reproducible in 5.2~Nightly build: 
5.2.1-81497a64cb-x86_64 (today end November)
Comment 1 Dorijan Salak 2024-03-08 01:32:34 UTC
Adding some extra info to this.
It's caused by recorder taking a snapshot (set by Capture interval) so easiest to reproduce it is to set capture interval low like 1 sec, take freehand selection tool make a selection and then quickly start tracing new selection or add to current, after set interval a new capture will happen and interrupt current tracing. 
A way to avoid it is to wait the set interval before making a new selection, however it will still capture new snapshot for every addition to the selection. Capturing selection actions is a waste of storage space as selections won't even be visible during timelapse and instead only show as pause without any update to the timelapse for a duration it took to finish selection.
Solution to this would be to simply exclude selection tool actions from being recorded, both for optimization reasons and to resolve this bug.
Comment 2 Edict 2024-07-28 00:43:02 UTC
It isn't dependent on document size, possible to reproduce on a single layer document.

Switching to selection tool swiftly to begin selection within the capture interval while the symbol is red gets it to interrupt the selection.

Making the capture interval 5 seconds means that after the mark is made if selection tool is used within that interval it gets interrupted by the end of the 5 seconds.

Krita 5.2.3-beta 1 (git 3e827a7) on windows 10
Comment 3 Edict 2024-07-28 01:45:28 UTC
Bug happened in 5.2 and 5.2.5-prealpha-c43e9bbe as well.
But is not present in 5.3.0-prealpha-a0775b3b
Comment 4 Dmitry Kazakov 2024-11-08 10:48:18 UTC
Git commit c99b19450ccbe79356597afe1fe4213a9791378d by Dmitry Kazakov, on behalf of Firstname Aqaao.
Committed on 08/11/2024 at 10:47.
Pushed by dkazakov into branch 'krita/5.2'.

Fixed: some tools is interrupted by recorder.

Related threads:
[bug#477715](https://bugs.kde.org/show_bug.cgi?id=477715)
[bug#484783](https://bugs.kde.org/show_bug.cgi?id=484783)

According to my tests, half of tools are affected.

This MR expanded tool blacklist and divide tools into two categories.

One is done in one step(like Line Tool), just disable recorder when such tools are activated(left button pressed on canvas).

One is done in multiple steps(like FreeHand Selection Tool), we need disable recorder in such tools all lifetime.
Related: bug 488472, bug 484783

M  +2    -0    libs/ui/canvas/kis_tool_proxy.cpp
M  +4    -1    libs/ui/canvas/kis_tool_proxy.h
M  +55   -8    plugins/dockers/recorder/recorder_writer.cpp
M  +1    -0    plugins/dockers/recorder/recorder_writer.h

https://invent.kde.org/graphics/krita/-/commit/c99b19450ccbe79356597afe1fe4213a9791378d
Comment 5 David REVOY 2024-11-08 12:43:38 UTC
Thank you so much Dmitry for fixing this bug that I have been experiencing so often on a daily basis for the past year! It will change my life. 👍
Comment 6 Dmitry Kazakov 2024-11-08 12:57:29 UTC
I'm glad it'll make your life easier, David! ;)