cogentcore / core

A free and open source framework for building powerful, fast, and elegant 2D and 3D apps that run on macOS, Windows, Linux, iOS, Android, and the Web with a single pure Go codebase, allowing you to Code Once, Run Everywhere.
http://cogentcore.org/core
BSD 3-Clause "New" or "Revised" License
1.32k stars 71 forks source link

back arrow cannot close main window! #884

Closed rcoreilly closed 4 months ago

rcoreilly commented 4 months ago

Describe the bug

the existing logic is apparently that if you're the last full window open, back arrow doesn't close you.

but in my simulation, I had some other windows open (shift + edits) and accidentally hit the back arrow too many times in my main sim window, and "poof" it went away, taking some interesting learned weights with it :(

Need better logic here, with some kind of flag or other property designating a main app window that cannot be closed by the back button!

How to reproduce

do it!

Example code

No response

Relevant output

No response

Platform

macOS

rcoreilly commented 4 months ago

proposed solution is that we add a flag for this on Stage (CloseOnBack), set this to true for all Dialog by default, false for all other FullWindow stages. thus, it can be overridden, but has sensible defaults. Inspector and Settings should be dialogs, to get these appropriate defaults, and befitting of their actual status.

kkoreilly commented 4 months ago

I implemented this in the commits above with a new CloseOnBack option on Stage.