Restoring a window from "hidden" state may reposition window

Issue Description:
When you call overwolf.windows.restore() on a hidden in-game window (a window you used overwolf.windows.hide() on), the position of the window updates if it isn’t fully in the viewport.

This is kind of a descent default (I think), however there should be a way to opt-out on that behavior. If a user wants an overwolf screen to be slightly out of the viewport we shouldn’t update that window whenever we hide() -> restore().

A use-case where you want a window to be partly out of the viewport, is when you reserve space for tooltips to show up. Depending on where the Overwolf window is in the viewport you want them to show up left or right. One side of the “reserved space” is very likely to be out of the viewport in this case.

A potential update to the API could involve an additional parameter to the
overwolf.windows.restore function where one can set an object with:
"{ restrainToViewport: boolean = false } " to disable the default behavior.

Additonally, the API docs (https://overwolf.github.io/docs/api/overwolf-windows#restorewindowid-callback) currently say:
“When restoring a minimized/maximized window, it restores the window to the previous size/position.”

It currently does not mention to reposition behavior that might be triggered.

I can confirm this, and would like to see the suggested solution implemented!

We added this request to our backlog, and will update you once it’s ready (no ETA yet)

I just noticed that when the game is not in focus, and you switch back to the game, the windows also change/reset position.

This means that changing overwolf.windows.restore() to have more parameters wouldn’t fix the problem. I guess this should become a flag on the window config in the manifest?

@heartharena you should add the following manifest flag to the relevant window:

"keep_window_location": true

It will force this window to keep it’s original location after minimize/hide() and restore() were used (it’s also handling the focus change you mentioned)