AdamsLair / duality

a 2D Game Development Framework
https://adamslair.github.io/duality
MIT License
1.41k stars 290 forks source link

Duality Editor Crashes when Tile Palette and Camera share dock #694

Open helle253 opened 5 years ago

helle253 commented 5 years ago

Summary

It was observed that, when the tile palette and camera share the same dock, and certain window manipulations are done (unclear what the exact list is, but there are multiple mechanisms), the tile palette will constantly attempt to resize and freeze the editor

How to reproduce

Place the tile palette and camera in the same dock. Attempt to move the tile palette to a different dock. Observe that the tile palette gets stuck resizing and the application freezes.

Workaround

Ensure the camera and tile palette do not share the same dock.

Analysis

Not sure what the exact mechanisms are. More investigation is needed.

Attachments

46986733-86438f80-d0b6-11e8-8b24-695c5a2fd4ef

cowmanjoe commented 5 years ago

Looks like this is caused by the TilemapEditorCamViewState closing the SourcePaletteTilesetView when it calls onHidden() is triggered by the window being taken over in line 675. It seems like the class makes the assumption that it created the tile palette so it is responsible for closing it. This seems to cause an infinite loop of events since it closes the tile palette, but the tilemap editor no longer needs to be hidden.

ilexp commented 5 years ago

Good catch! Maybe closing the tile palette could be guarded by a docking check, so it will only be closed if not in the same docking group. Not entirely sure the required info is available where the decision is made, and we'd need to respect the Request / Pop symmetry, but could be worth looking into.