Implement a feedback for barrier blocking when doing some actions
ClosedPublic

Authored by dkazakov on Nov 22 2016, 8:44 AM.

Details

Summary

Some actions should not be started before all the previous actions
are finished. That is especially true for the actions that work
with layers stack, like "Merge Down" and "Flatten".

Now KisDelayedSaveDialog is used not only for saving, but also for
waiting before doing usual actions. It also has a busy-loop timeout of
1 second before showing up, for not distracting painters from their
workflow when the action is postponed only a little bit.

BUG:372724
Fixes T4593

Test Plan

Basically, the steps like in bug 372724.

  1. Select multiple layers
  2. Start a long stroke (1000px colorsmudge brush is a good example)
  3. Press Ctrl+E *multiple* times quickly
  4. After all the background work is finished, press Ctrl+Z

There should be no crash, and the result should be somewhat expected.

Repeat the same for:

  1. Merge down
  2. Flatten Image
  3. Flatten Layer
  4. Transform a layer using "Layers" menu(?)

Diff Detail

Repository
R37 Krita
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
dkazakov updated this revision to Diff 8377.Nov 22 2016, 8:44 AM
dkazakov retitled this revision from to Implement a feedback for barrier blocking when doing some actions.
dkazakov updated this object.
dkazakov edited the test plan for this revision. (Show Details)
dkazakov updated this revision to Diff 8379.Nov 22 2016, 8:59 AM

Fixed compilation

rempt added a subscriber: rempt.EditedNov 22 2016, 9:49 AM

It may be safer, but I think that this isn't moving Krita in the right direction. Krita shouldn't bother the user with popups telling the user to wait until it's done, it should just do its job. We shouldn't be exposing the design faults of our code in this way.

Note: I'm fine with this for now, for safeties sake -- but I think we should sit down and solve this problem in a more fundamental way.

In D3449#64287, @rempt wrote:

It may be safer, but I think that this isn't moving Krita in the right direction. Krita shouldn't bother the user with popups telling the user to wait until it's done, it should just do its job. We shouldn't be exposing the design faults of our code in this way.

Well, I'm ok with discussing this stuff. But please note two points:

  1. All the actions should be split into two groups: a) need full barrier synchronizations before starting (e.g. Filter or Image Size Dialog); b) can be started asynchronously, and should not disturb the user with any popups (e.g. Merge Down). For the first group we will still have to show some popup/dialog. For the second --- not.
  1. Some time ago (more exactly in 2012) @langkamp and me started to design a system for doing things like that: KisOperationRegistry and friends. The problem is that we need quite a bit of manpower for that, so the project has never been completed :(
rempt accepted this revision.Dec 6 2016, 12:56 PM
rempt added a reviewer: rempt.

It seems to work for me, but I do get a lot of, when rapidly merging and undoing:

krita.core: BUG: The walker hasn't reached the root layer!
krita.core: Start node: KisPaintLayer(0xd8cd1c0, name = "Layer 6") Requested rect: QRect(0,0 512x512)
krita.core: There must be an inconsistency in the walkers happened!
krita.core: Please report a bug describing how you got this message.
krita.core: BUG: The walker hasn't reached the root layer!
krita.core: Start node: KisPaintLayer(0xd8cd1c0, name = "Layer 6") Requested rect: QRect(1024,0 512x512)
krita.core: There must be an inconsistency in the walkers happened!
krita.core: Please report a bug describing how you got this message.
krita.core: BUG: The walker hasn't reached the root layer!
krita.core: Start node: KisPaintLayer(0xd8cd1c0, name = "Layer 6") Requested rect: QRect(1536,0 512x512)
krita.core: There must be an inconsistency in the walkers happened!
krita.core: Please report a bug describing how you got this message.
krita.core: BUG: The walker hasn't reached the root layer!
krita.core: Start node: KisPaintLayer(0xd8cd1c0, name = "Layer 6") Requested rect: QRect(512,512 512x512)
krita.core: There must be an inconsistency in the walkers happened!
krita.core: Please report a bug describing how you got this message.
krita.core: BUG: The walker hasn't reached the root layer!
krita.core: Start node: KisPaintLayer(0xd8cd1c0, name = "Layer 6") Requested rect: QRect(512,0 512x512)
krita.core: BUG: The walker hasn't reached the root layer!
krita.core: There must be an inconsistency in the walkers happened!
krita.core: Start node: KisPaintLayer(0xd8cd1c0, name = "Layer 6") Requested rect: QRect(2048,0 432x512)
krita.core: There must be an inconsistency in the walkers happened!
krita.core: Please report a bug describing how you got this message.
krita.core: Please report a bug describing how you got this message.
krita.core: BUG: The walker hasn't reached the root layer!
krita.core: Start node: KisPaintLayer(0xd8cd1c0, name = "Layer 6") Requested rect: QRect(0,512 512x512)
krita.core: There must be an inconsistency in the walkers happened!
krita.core: Please report a bug describing how you got this message.

This revision is now accepted and ready to land.Dec 6 2016, 12:56 PM
This revision was automatically updated to reflect the committed changes.
This revision is now accepted and ready to land.Dec 7 2016, 1:28 PM

yes i got this dialog box too while testing, but it goes away after some time for me . i didn't try to convert color space though. it used to trigger when i painted a heavy stroke and did some layer operation.