Skip to content

Commit

Permalink
Merge pull request #23 from antonk777/master
Browse files Browse the repository at this point in the history
Fix ingame window not appearing
  • Loading branch information
eransharv authored Jun 3, 2021
2 parents 3e909eb + 6a79882 commit 9e50bc1
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion native/windows/background/background-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ define([
BackgroundController._onRunningGameChanged
);

overwolf.extensions.onAppLaunchTriggered.addListener(e => {
if (e && e.source !== 'gamelaunchevent')
BackgroundController._restoreLaunchWindow();
});

// Listen to changes in windows
overwolf.windows.onStateChanged.addListener(async () => {
// If there's only 1 window (background) open, close the app
Expand Down Expand Up @@ -90,10 +95,21 @@ define([
);

await WindowsService.restore(WindowNames.IN_GAME);
WindowsService.minimize(WindowNames.IN_GAME);

if (BackgroundController._launchedWithGameEvent()) {
WindowsService.minimize(WindowNames.IN_GAME);
}
}
}

/**
* app was launched with game launch
* @private
*/
static _launchedWithGameEvent() {
return location.href.includes('source=gamelaunchevent');
}

/**
* set custom hotkey behavior
* @private
Expand Down

0 comments on commit 9e50bc1

Please sign in to comment.