1) Bring forward suspend time when before-quit.
** When OnTerminate is coming first earlier than OnPause,
'quit' makes this.webApplication as undefined, then
wrt.on('suspend'...) will be skipped. This means that
With normal termination sequence, suspending might be not
handled.
2) Even though background runnable app, when app is in quitting,
enable suspend sequence for right termination sequence.
Change-Id: Ie40f650ea317d6f198f9c1c1aa07c9bc6867b693
Signed-off-by: DongHyun Song <dh81.song@samsung.com>
runningStatus = 'none';
suspended = false;
windowList: Electron.BrowserWindow[] = [];
+ inQuit = false;
constructor(options: RuntimeOption) {
if (options.launchMode == 'backgroundAtStartup') {
}
suspend() {
+ if (this.suspended)
+ return;
console.log('WebApplication : suspend');
addonManager.emit('lcSuspend', this.mainWindow.id);
this.suspended = true;
this.windowList[this.windowList.length - 1].hide();
this.flushData();
- if (!this.backgroundRunnable()) {
+ if (!this.backgroundRunnable() || this.inQuit) {
if (!this.multitaskingSupport) {
// FIXME : terminate app after visibilitychange event handling
setTimeout(() => {
quit() {
console.log('WebApplication : quit');
addonManager.emit('lcQuit', this.mainWindow.id);
+ this.inQuit = true;
+ if (!this.suspended)
+ this.suspend();
}
private flushData() {