The bug causes data loss only in subwindow mode with both subwindows visible. Tabbed mode or subwindows both in full screen and using the menu to switch documents does not trigger apparently any issue. Tested on 5.1.5, and master (21c93450d8) To reproduce: make 2 images A and B (A is source with paint info, B will be empty here) Select from image A Edit-> Paste into active layer: to B (!this is important as paste into active layer activates transform) Ctrl + Z <- undo should make the transform go away, but it doesn't until the second a undo is perform Ctrl + Z <- transforms dissapears Go back image A, Copy Activate image B Depending on windows some minor differences happen Tabs: A legend "cannot transform empty region" (this assumes initial condition of empty image B) Subwindows: A ghost transform decoration (in the video) appears, the image A tile data is deleted, this is permanent if transform is done in any way to this ghost outline, if enter is pressed the data reapppers in image A. If the transform mask is modified in this state then returning to image A and deleting the selection and then selecting image B subwindow destroys the entire paint data of image A. Terminal output 2023-10-10 15:33:56.755317-0600 krita[95800:4455524] [krita.general] Unexpected tool event has come to cancelStroke while being mode 0 ! 2023-10-10 15:18:07.888869-0600 krita[95588:4445691] SAFE ASSERT (krita): "dst->lodData->levelOfDetail() == defaultBounds->currentLevelOfDetail()" in file /Users/daedalus/developer/krita/repos/master/krita/libs/image/kis_paint_device.cc, line 845 2023-10-10 15:18:10.646901-0600 krita[95588:4446046] SAFE ASSERT (krita): "changeList.memento == memento" in file /Users/daedalus/developer/krita/repos/master/krita/libs/image/tiles3/kis_memento_manager.cc, line 275 2023-10-10 15:18:46.549543-0600 krita[95588:4444795] [krita] CGImageDestinationAddImage:4060: *** ERROR: CGImageDestinationAddImage: cgImage is nil 2023-10-10 15:18:46.550962-0600 krita[95588:4444795] [krita] finalizeDestination:3167: *** ERROR: image destination must have at least one image 2023-10-10 15:18:46.552450-0600 krita[95588:4444795] [krita.general] Warning: some tiles have leaked: 2023-10-10 15:18:46.552463-0600 krita[95588:4444795] [krita.general] Tiles in memory: 249
Created attachment 162204 [details] undo crash it sometimes causes krita to crash trying to undo many times into the original image A state
Created attachment 162205 [details] backtrace closing when closing krita in the corrupt state it often shows this backtrace.
Created attachment 162206 [details] subwindow arragement for test at the end Pasting is shown as "Add Node" in Undo history docker
I cannot fully reproduce the issue on Windows in master (1e0e095b69513d9a9d0a9b53c0512f50e3fc7977). Though I can reproduce a part of the issue. When I change the active subwindow, a part of "old" subwindow gets transparent for a moment and then returns back into the normal state. I have a feeling, that the transform tool gets momentary activated and deactivated **before** the subwindows actually manages to change. Ivan, could you check if you can reproduce the issue in the following way: 1) Open two documents like in your setup 2) In Document A activate rectangle selection tool, select something 2) In Document B activate Transform Tool 3) Try switching between the documents back and forth. Do you still see the issue? At least partially?
Created attachment 173575 [details] Faulty state Following your instructions I get a partial result, there is no dataloss but the rendering could indicate a lost signal. (attached image of the faulty state). After making a selection on A and activating transform on B: alternating focus of window A and B causes the state in the attachment. Window B is in focus for Window A to show the partial render. This by itself does not cause any data loss, and any action performed either in B or A will restore the full render on window A.