overwolf / sample-app

The Official Overwolf Sample App
https://overwolf.github.io/
119 stars 136 forks source link

Calling minimize starts a process #33

Closed gabrielmicko closed 3 years ago

gabrielmicko commented 3 years ago

Hey,

I think this is an issue: I pretty much reused your sample app. When I click on my DESKTOP window and minimize the app it calls this function in the BG screen. Calling this.windowsService.minimize(kWindowNames.IN_GAME) boots up the ingame process. I think this is really unwanted behaviour. My desktop and in-game apps look the same they have the same code. I inject the Advertisement SDK when the app is opened. Because of this it happens that the SDK code runs twice at the same time and I happen to fail the review process.

Do you guys think that there should be a handle in this function to only call minimize when the window is really open?

https://github.com/overwolf/sample-app/blob/master/native/windows/background/background-controller.js

  async minimize() {
    await Promise.all([
      this.windowsService.minimize(kWindowNames.DESKTOP),
      this.windowsService.minimize(kWindowNames.IN_GAME)
    ]);
  }
eransharv commented 3 years ago

Hey @gabrielmicko and thank you. We pushed a fix.

gabrielmicko commented 3 years ago

Awesome