Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LTS] nwjs 0.16 - MacOS 10.10 - nw.global.__nw_windows not correct #5181

Open
AndryBray opened this issue Aug 2, 2016 · 22 comments
Open

[LTS] nwjs 0.16 - MacOS 10.10 - nw.global.__nw_windows not correct #5181

AndryBray opened this issue Aug 2, 2016 · 22 comments
Assignees

Comments

@AndryBray
Copy link

My app handles the running instances of every window and it was working good with 0.14 & 0.15.
On v 0.16 I see there is some problem with nw.global.__nw_windows
It doesn't store always the right number of opened windows.
E.g. if I open 5 windows I see just 2 NWWindow object inside nw.global.__nw_windows

@AndryBray
Copy link
Author

AndryBray commented Aug 2, 2016

@rogerwang is there any other way to get all running windows (nwwindow instances)? I'm trying chrome api but it doesn't allow to access the window object (e.g. window.document)

@AndryBray
Copy link
Author

@rogerwang just tested on Windows and it's the same... very often some window instance will not be tracked to the __nw_windows store var.

@rogerwang
Copy link
Member

We'll provide nw.Window.getAll(). Before that you can use https://developer.chrome.com/apps/app_window#method-getAll

We'll see the issue about __nw_windows.

@AndryBray
Copy link
Author

AndryBray commented Aug 4, 2016

@rogerwang tested even with chrome.app.window.getAll() and it's the same... worst.. it shows only 1 AppWindow running (when actually I have 5 windows).

Instead if I use chrome.windows.getAll(function(wins) { console.log(wins) }) it works but this method will not give us access to the contentWindow node (to access the document)

@AndryBray
Copy link
Author

@rogerwang do you have any planned date for this issue solving? It could be blocking for who need to handle number of window instances. Thank you

@AndryBray
Copy link
Author

up

@AndryBray
Copy link
Author

@rogerwang tested the new version 0.17 (latest):
on MacOS version nw.global.__nw_windows now works well
on Windows version nw.global.__nw_windows does not hold the correct number of windows (tested on Windows 7)

@AndryBray
Copy link
Author

Hello @rogerwang
is this issue a 0.18 version priority?
Sorry if I'm repetitive but I just need to know if I have to develop my own window manager.
Thank you

@rogerwang
Copy link
Member

@AndryBray I'll try to fix it soon in 0.17. Thanks.

@rogerwang rogerwang self-assigned this Sep 8, 2016
@rogerwang
Copy link
Member

does it happen only when you open windows with remote URLs?

@AndryBray
Copy link
Author

I only use remote urls. I'll try with local as well

@AndryBray
Copy link
Author

@rogerwang I've just tested the live build version https://dl.nwjs.io/live-build/09-10-2016/nw17-4c8d707-20839a2-dacfec0-65b948e/v0.17.2/

I still have the same problem (tested on Windows 7)

@rogerwang
Copy link
Member

Did you test with chrome.app.window.getAll()? That's what I was fixing.

@AndryBray
Copy link
Author

@rogerwang OK. I was still using the nw.global.__windows object instead of chrome API.

Using the chrome api it seems to work.

Just for info:
using chrome.app.window.getAll() with the sdk build, if I have dev console opened I get an array with NULL values like: [AppWindow, null, AppWindow]
Maybe the null value could be skipped automatically.

It's a pity that we still have problems with nw.window.open callback with undefined wind value.
I think #4188 is still there.

@AndryBray
Copy link
Author

@rogerwang is this bugfix applied on 0.14.x version as well?

@AndryBray
Copy link
Author

@rogerwang about the NULL value I found it's not related to dev console but chrome.app.window.getAll() will return NULL values if you try to reload the content (CMD+R) of window.
I think this shouldn't be the normal behaviour.

Tested on 0.18 beta-1 as well.

@rogerwang
Copy link
Member

Yes, it will be applied to LTS branch too. Reopen to track this.

@rogerwang rogerwang reopened this Sep 13, 2016
@AndryBray
Copy link
Author

@rogerwang it would be nice to have a kind of roadmap for issues just to know your estimation about the problems solving or just to know if you are working on.
Thank you, I appreciate your effort in every release you publish.

Any idea about this one especially?

@rogerwang
Copy link
Member

Will see this before 0.17.3. I was about to fix it in 0.17.2 but was
occupied by upstream release with security updates.

On Wed, Sep 14, 2016, 9:43 PM AndryBray [email protected] wrote:

@rogerwang https://github.com/rogerwang it would be nice to have a kind
of roadmap for issues just to know your estimation about the problems
solving or just to know if you are working on.
Thank you, I appreciate your effort in every release you publish.

Any idea about this one especially?


You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
#5181 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAKGGV95n4kcDb3C0Cgkd9OQrvSCool0ks5qp_n2gaJpZM4JaYfu
.

@rogerwang
Copy link
Member

Google just released another Chromium stable update in the next day after the previous one. So I'm going to release 0.17.3 soon and this issue will be likely slip into 0.17.4.

@rogerwang
Copy link
Member

returning null is fixed in #5294

@rogerwang rogerwang changed the title nwjs 0.16 - MacOS 10.10 - nw.global.__nw_windows not correct [LTS] nwjs 0.16 - MacOS 10.10 - nw.global.__nw_windows not correct Sep 20, 2016
@mariomui-viscira
Copy link

@rogerwang tested even with chrome.app.window.getAll() and it's the same... worst.. it shows only 1 AppWindow running (when actually I have 5 windows).

Instead if I use chrome.windows.getAll(function(wins) { console.log(wins) }) it works but this method will not give us access to the contentWindow node (to access the document)

it does work you just have to remember that the window opens in the context of the newly focused window. if you open chrome debugger of the latest window you should see that all your windows are all open.
place this inside the callback of your xx.open(..., ( childwin) => ....
const oWindows = childwin.window.chrome.app.window.getAll();
oWindows.forEach((oWindow) => {
if (oWindow.id !== '' && oWindow.id !== modalName) {
oWindow.close(true);
}
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants