Diffusion Krita 5aef0e99a7b6

Make sanity check in CanvasSwitcher less strict

Authored by dkazakov on May 29 2020, 2:41 PM.

Description

Make sanity check in CanvasSwitcher less strict

I couldn't reproduce the crash, but the mechanics happens like that:

  1. KisCanvas2::setCanvasWidget() adds the canvas to the list of the tracked ones and continues loading process.
  1. Some other canvas gets activated by spontaneous SetFocus event (Note: I haven't managed to reproduce that!)
  1. KisMainWindow::addView() registers the canvas at the input manager again. But since some other canvas has been activated by a spontaneous event, d->canvas is not equal to canvas anymore.

Possible solutions:

Option A:
Remove double registration of the canvas in the input manager and do
it only once either in KisCanvas::setCanvasWidget() or in KisMainWindow

Option B:
Justremove the sanity check. But this way we may miss real bugs that
may happen because of double initialization of the canvas.

CCBUG:421518

Details

Committed
dkazakovMay 29 2020, 3:11 PM
Parents
R37:1ae5800ac50d: Fix minor spacing
Branches
Unknown
Tags
Unknown