Moving Window from In-game to Second Screen and back

Dear Overwolf,

Sergio recommended us to have a second screen that can be brought into the game using a hotkey and then having it move out again.

Is there such a functionality? I have not found it. Any help would be highly appreciated.


Screenshot of Sergio’s proposal:

Hey @Michel,

We are planning to create soon a sample app that demonstrates this exact behavior. But right now, I don’t have any code example that I can share. So I will explain how to implement it at a high level:

First of all, we will define three different windows on the manifest level (at least, you may specify more, of course, depending on your app needs):

  1. Desktop-only window, a native window is preferable.
    You will use this window to display content only on the second screen desktop.
  2. In-game-only window.
    You will use this window to display the same content as the desktop - but as an in-game overlay.
  3. Background controller.
    Do all the “regular” things that bg controller does, but also responsible for “moving” your content
    between window #1 and window #2 - using a hotkey.

So when the app is launched, the background controller identifies two screens and displays the content automatically on the second screen (means - open your desktop window).

On the first screen, the user plays the game. Upon demand (when the user hits the hotkey), the background controller listens to it, hides the desktop window (or closes it), opens the in-game window, and “inject” all the content into it. The “Switch” is over, and your end-user now can see only one in-game window that displays the same content as the desktop window.

When the user hits the hotkey again - you do the same and switch back to the content to the desktop and hide/close the in-game window.

You can enhance this process more. For example - when the desktop window is displayed, you can show a small in-game widget that reminds the user that the desktop window is “on,” and he can move it to the game if he hit the hotkey. Etc.

I hope it’s clear and makes sense.