Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions ElectronNET.API/Entities/BrowserWindowOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,14 @@ public class BrowserWindowOptions
public bool Frame { get; set; } = true;

/// <summary>
/// Whether this is a modal window. This only works when the window is a child
/// window.Default is false.
/// Whether this is a modal window. This only works when <see cref="Parent"/> is
/// also specified. Default is false.
/// </summary>
public bool Modal { get; set; }

/// <summary>
/// Whether the web view accepts a single mouse-down event that simultaneously
/// activates the window.Default is false.
/// activates the window. Default is false.
/// </summary>
public bool AcceptFirstMouse { get; set; }

Expand Down Expand Up @@ -270,5 +270,11 @@ public class BrowserWindowOptions
/// These will only be used if the Proxy field is also set.
/// </summary>
public string ProxyCredentials { get; set; }

/// <summary>
/// The window to use as the created window's parent.
/// </summary>
[DefaultValue(null)]
public BrowserWindow Parent { get; set; }
}
}
3 changes: 3 additions & 0 deletions ElectronNET.Host/api/browserWindows.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions ElectronNET.Host/api/browserWindows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,10 @@ export = (socket: Socket, app: Electron.App) => {
options = { ...options, webPreferences: { nodeIntegration: true, contextIsolation: false } };
}

if (options.parent) {
options.parent = BrowserWindow.fromId(options.parent.id);
}

// we dont want to recreate the window when watch is ready.
if (app.commandLine.hasSwitch('watch') && app['mainWindowURL'] === loadUrl) {
window = app['mainWindow'];
Expand Down