What determines the end of a flight?

When shutting down the aircraft after a flight, at some point the logbook
popup appears (or not if you deactivated it in the settings, however it’s
still noticeable that it tries to open). How exactly is this state determined?
I noticed different behaviour in different aircraft (e.g. engines off in one
A/C triggers it and on another A/C it’s happening after the aircraft is
completely C&D; only).

It happens when: All engines are shut down, the plane is on the ground, the
plane is not moving, and the avionics aren’t powered. The last one is probably
what causes the difference between planes. The relevant simvar is: CIRCUIT AVIONICS ON

Thank you, that sounds good. Just out of curiosity, is this behavior
documented (if yes shame on me) or did you find it out by yourself?

It isn’t documented. I got it by analyzing the files in the ‘asobo-
freeflights’ package.