Skip to content

Commit 008d981

Browse files
committed
Don't bind the current shell when create the new-instance Window
Fix nwjs#948
1 parent 8f03612 commit 008d981

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/api/window/window.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ exports.Window = {
5656

5757
// Create new shell and get it's routing id.
5858
var routing_id = nw.createShell(url, options);
59-
return new global.Window(routing_id);
59+
60+
return new global.Window(routing_id, options['new-instance']);
6061
}
6162
};

src/api/window_bindings.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function Window(routing_id) {
1+
function Window(routing_id, nobind) {
22
// Get and set id.
33
var id = global.__nwObjectsRegistry.allocateId();
44
Object.defineProperty(this, 'id', {
@@ -15,7 +15,8 @@ function Window(routing_id) {
1515

1616
// Tell Shell I'm the js delegate of it.
1717
native function BindToShell();
18-
BindToShell(this.routing_id, this.id);
18+
if (!nobind)
19+
BindToShell(this.routing_id, this.id);
1920
}
2021

2122
// Window will inherit EventEmitter in "third_party/node/src/node.js", do

0 commit comments

Comments
 (0)