Bug 446091 - Copy Pasting selections acting slow and incorrectly
Summary: Copy Pasting selections acting slow and incorrectly
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (show other bugs)
Version: nightly build (please specify the git hash!)
Platform: Compiled Sources All
: NOR normal
Target Milestone: ---
Assignee: sh_zam
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2021-11-25 22:01 UTC by Rexel
Modified: 2021-12-01 08:46 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
incorrect pasting and lag seen in a short clip (436.58 KB, video/mp4)
2021-11-25 22:01 UTC, Rexel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rexel 2021-11-25 22:01:08 UTC
Created attachment 143947 [details]
incorrect pasting and lag seen in a short clip

SUMMARY

STEPS TO REPRODUCE
1. Select an area of the background layer using any selection tool
2. Press CTRL+C
3. Press CTRL+V

OBSERVED RESULT
After pressing CTRL+C, Krita will take a while to load, 1-2 second freeze. It can be seen from the marching ants of the selection outline. The selection will fill the outside areas with white when pasting the clipboard to a new layer. And it would also paste an incorrect shape when copying using non-rectangular selections. 

The freeze still occurs for copying from any layer besides the background layer but the pasting issues aren't present.

EXPECTED RESULT
CTRL+C will not trigger any sort of lag or freeze as seen in Krita 4, and copying from the background wouldn't have any weird issues with the pasted selection.

 Version: 5.1.0-prealpha (git ef9dc1d)
 Languages: en_US, en
 Hidpi: true

Qt

  Version (compiled): 5.12.11
  Version (loaded): 5.12.11

OS Information

  Build ABI: x86_64-little_endian-llp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: winnt
  Kernel Version: 10.0.19042
  Pretty Productname: Windows 10 (10.0)
  Product Type: windows
  Product Version: 10
Comment 1 Ahab Greybeard 2021-11-26 17:09:12 UTC
I can confirm this for the Nov 26 5.1.0-prealpha (git 4a272ff) appimage on debian 10.
It does not happen with the 5.0.0-beta2 appimage.

The delay/freeze in my case is about 8 seconds due to using an old computer.

The selected region is pasted correctly but everything outside the bounding box of the selection shape becomes white.
Comment 2 Ahab Greybeard 2021-11-28 07:57:15 UTC
This commit:
https://invent.kde.org/graphics/krita/commit/c00ecf945aee90d7f3601508bfc3b4235ef05693
has fixed the problems of the pasted area shape and of filling outside with white when tested with the Nov 27 5.1.0-prealpha (git 72b21b1) appimage.

However, the Copy action still gives a long delay/freeze.
Comment 3 Bug Janitor Service 2021-11-30 21:09:24 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/1190
Comment 4 Dmitry Kazakov 2021-12-01 08:45:55 UTC
Git commit a81d83d340ea0fa0fcee652963faf262b92a07c3 by Dmitry Kazakov, on behalf of Sharaf Zaman.
Committed on 01/12/2021 at 08:45.
Pushed by dkazakov into branch 'master'.

Bugfix: slow down caused by cut/copying selection

Creating documents on fly with resource storage registered is expensive.

M  +1    -1    libs/ui/kis_mimedata.cpp

https://invent.kde.org/graphics/krita/commit/a81d83d340ea0fa0fcee652963faf262b92a07c3
Comment 5 Dmitry Kazakov 2021-12-01 08:46:12 UTC
Git commit 2b14e3bf577c30f0ad0e2528f5dc7260d5897da3 by Dmitry Kazakov, on behalf of Sharaf Zaman.
Committed on 01/12/2021 at 08:46.
Pushed by dkazakov into branch 'krita/5.0'.

Bugfix: slow down caused by cut/copying selection

Creating documents on fly with resource storage registered is expensive.
(cherry picked from commit a81d83d340ea0fa0fcee652963faf262b92a07c3)

M  +1    -1    libs/ui/kis_mimedata.cpp

https://invent.kde.org/graphics/krita/commit/2b14e3bf577c30f0ad0e2528f5dc7260d5897da3