Bug 462095 - Transform Tool breaks if another Tool is invoked at the same time as using a shortcut operation, causing data loss
Summary: Transform Tool breaks if another Tool is invoked at the same time as using a ...
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Tools/Transform (other bugs)
Version First Reported In: 5.1.1
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-21 12:13 UTC by Julien Kaspar
Modified: 2022-11-21 15:52 UTC (History)
1 user (show)

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


Attachments
Visual example if the issue. (1.33 MB, video/mp4)
2022-11-21 12:13 UTC, Julien Kaspar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Julien Kaspar 2022-11-21 12:13:13 UTC
Created attachment 153924 [details]
Visual example if the issue.

SUMMARY
Issue: You can "Invoke" a Tool via a shortcut (in this case the Line Tool) while the Transform Tool is still active and being used. If an operation is used in this invoked state (in this case Inverting the selection), the transform tool breaks, leading to data loss and glitches.

It seems unlikely to cause this issue in the default keymap.
This is especially likely to happen if a tool is invoked on modifier keys 
(For example using `Shift` instead of `V` to invoke the Line Tool).


STEPS TO REPRODUCE

1. Set custom shortcuts
a. Canvas Input Settings -> Tool Invocation -> Activate Line Tool == `Shift + LMB`
b. Canvas Input Settings -> Change Primary Settings -> Normal == `Remove`
c. Keyboard Shortcuts -> Krita -> General -> Invert Selection == `Shift + D`

2. Create a selection
3. Use the Transform Tool (Ctrl - T)
4. Move the selection
5. Press `Shift + D` to invert the selection
6. Use any brush on selection

OBSERVED RESULT
The transformed result will be erased but still be visually shown, as if the transformation was applied.
The selected area will be moved back to the original position, before the transform tool was used.
The selection will be successfully inverted (But at the incorrect position).
Any brush stroke, no matter the selected area, will redraw the canvas, revealing the true state of the image.

EXPECTED RESULT
The transformation will be properly applied when using the shortcut `Shift + D`.
Only then, will the selection be updated tot he correct position and properly inverted.
Any brush strokes will then properly paint on the applied transformation and inverted selection (Without visual glitches).

SOFTWARE/OS VERSIONS
Krita

 Version: 5.1.1
 Hidpi: true

Qt

  Version (compiled): 5.15.5
  Version (loaded): 5.15.5

OS Information

  Build ABI: x86_64-little_endian-lp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: linux
  Kernel Version: 6.0.9-gentoo
  Pretty Productname: Gentoo Linux
  Product Type: gentoo
  Product Version: 2.9
  Desktop: KDE
Comment 1 Halla Rempt 2022-11-21 15:06:21 UTC
Could check whether this is fixed in the latest nightly unstable build? Dmitry thinks it may have been fixed already. See https://binary-factory.kde.org/job/Krita_Nightly_Appimage_Build/
Comment 2 Julien Kaspar 2022-11-21 15:34:10 UTC
Thanks for the quick reply! I tested the nightly build and the issue is indeed fixed. 

I noticed another issue as a result (But it's not related to this report anymore).
The transform tool will immediately be executed on the inverted selection instead. This is not ideal.
Also, if the shortcut to invert the selection is pressed fast enough in succession, it will sometimes not execute the transform tool.

I suggest to accept the transformation if another operation (Like inverting the selection) is done, but not execute the transform tool directly after. Instead wait for a Left Mouse Click input from the user.
Comment 3 Halla Rempt 2022-11-21 15:52:00 UTC
Please make a new report for that :-)