I've noticed an annoying behavior with Mojave (macOS 10.14). I use the Messages app all the time. Previously I would just hit the red X to close it when I was done messaging for the moment. The program however would remain open, just hidden. Now, after I hit the red X, within a few to perhaps 30 seconds, the Messages app closes completely (I can tell because the indicator dot on the Dock goes away). As a result, when I relaunch it, it takes an extra second or two (this can add up), and it sometimes opens in a different location than where it was before. Is there any way to turn off this behavior?
This is a feature introduced in macOS Lion 10.7 in 2011. If you're only noticing this since Mojave, that's a bug or the following setting you changed previously has been reset to default.
By default, since Lion, apps which support automatic termination with no open windows and not activated will quit after an idle period.
To disable this for all apps, override NSSupportsAutomaticTermination:
defaults write -g NSSupportsAutomaticTermination -bool false
To find apps which support automatic termination in your /Applications folder, you can use
grep -nl NSSupportsAutomaticTermination /Applications/*/Contents/Info.plist
Note that automatic termination is distinct to functionality more commonly used by third-party apps: applicationShouldTerminateAfterLastWindowClosed(_:).