obtainDeclaredWindow error with native window and useDefaultSizeAndLocation to true

  • Bug Description:
    overwolf.windows.obtainDeclaredWindow fails with null pointer exception when called with useDefaultSizeAndLocation: true .

No error with useDefaultSizeAndLocation: false or without passing the parameter at all.

More details on this Slack thread: Slack

  • impact for my app: [low, mid, high, show-stopper]. High

@dowmeister I was not able to reproduce it.

When I’m calling this from the sample app for example:

let winx = overwolf.windows.obtainDeclaredWindow("in_game",{ useDefaultSizeAndLocation: true },console.log)

I get the ref as expected.

Can you please tell me how to reproduce your issue?

The way to reproduce is described on slack: a native window opened with useDefaultSizeAndLocation at true.

This is the manifest declaration:

"DesktopWindow": {

        "block_top_window_navigation": true,

        "popup_blocker": true,

        "mute": true,

        "resizable": true,

        "file": "build/DesktopWindow.html",

        "override_on_update": true,

        "transparent": true,

        "desktop_only": true,

        "native_window": true,

        "size": {

          "width": 1200,

          "height": 910

        }

To clarify: is it working for you with the same settings just native:false ?

Update: ok, I was able to reproduce the issue for one time, and then I was not… really strange.
I will investigate it more. But it looks like a bug.

Thanks.

Hi,

We added the bug to our backlog for further examination.
Currently, there is no ETA, but I will update you here once the fix is released.

Thanks.

This issue is blocking the new release.

Gilmat reported the Desktop Window opened like this today image because i’m passing “false”.

And i cannot reproduce it, also if uninstalling and reinstalling, the window is always opened correctly.

Should i remove something from Ow Client Cache?

@dowmeister, when I’m changing the DesktopWindow to native: false, everything is working as expected (please test and confirm that too).

So there is an issue with the combo of useDefaultSizeAndLocation: true on native windows.

I will have to forward it to our R&D for a more in-depth examination, as on our tests, it’s worked with native windows.

Thanks for your patience.

@HeeeySusu @Icywave25 FYI

yes, with false it works fine.

After talked also with Gal, i’ll make it not native and pass it true to avoid problems on sizing and positions but in future, when fixed, i would use native windows for desktop ones because it looks better and opens quickly.

Thanks for the support

1 Like

Hi, I wanted to update you that it’s a bug, and we will fix it in one of the next iterations.

Thanks, I will update here once it is ready (please be patient, that might take some time).

Hi.
The issue should be fixed in OW v0.165 released to the developer’s channel in a few days. I will let you know.

Thanks.

1 Like

On 0.165.0.5 still error.

@dowmeister, before I’m returning it to the R&D, can you please check it on the latest version of the developer’s channel? As it was updated recently.

On 165.0.28 seems working but…

overwolf.windows.getMainWindow() returns undefined. This make impossible for the native window communicate with the background window.

@dowmeister I tested it, and it’s working as expected. Can you give it another try and tell me from which window you call it, steps to reproduce with your OPK, etc. I want to understand why I can’t reproduce it.

i think you can reproduce it using the current production version, setting DesktopWindow as native_window at true.
when opened, it works, but some things aren’t working like the close button or dont show the version in the bottom left corner because overwolf.windows.getMainWindow() returns undefined

@dowmeister, I looked on your manifest - and I see that your background window has many unwanted flags. The only flags that you should set are:

    "start_window": "background",
        "windows": {
          "background": {
            "file": "build/index.html",
            "is_background_page": true
          }

Besides, there should not be an issue to get a ref to the main window from native windows. I checked it on our sample app, as it’s a “clean” app (to eliminate other issues that might be in your app), and it worked as expected.

Please update me.

i have no clue. It works intermittently.
After modified the manifest.json removing useless flags from background, i had to reinstall the unpacked version to make it work otherwise the null reference while opening the desktop window (the initial issue).
Then, using the DesktopWindow the version in the bottom left corner disappear, means the background window become undefined.

This version with fixed background props and DesktopWindow as native is this: Dropbox - File Deleted
hope this helps to reproduce it. If you need, i can share the source giving access to gitlab.

@dowmeister, to clarify - the OPK you attached in your last message is the OPK with the issue? no version number at bottom left + (when DesktopWindow defined as native)

exactly, the version with the issue