Skip to content

Can't change the bounds on a BrowserView before calling browserWindow.SetBrowserView #458

@MopsieX

Description

@MopsieX
  • Version: 9.31.2

Steps to Reproduce:

  1. Create a BrowserWindow
BrowserWindow browserWindow = await Electron.WindowManager.CreateWindowAsync(new BrowserWindowOptions
            {
                Width = 500,
                Height = 500,
                Frame = false,
                Transparent = true
            });
  1. Create a BrowserView(BrowserView bv = await Electron.WindowManager.CreateBrowserViewAsync();)
  2. Set the Bounds of the BrowserView
var bounds = await browserWindow.GetBoundsAsync(); 
bv.Bounds = new Rectangle() { Height = bounds.Height, Width = bounds.Width, X = 0, Y = 0};
  1. Set the BrowserView(browserWindow.SetBrowserView(bv))

If you set the bounds of the BrowserView before you call SetBrowserView the BrowserView's bounds will be {0,0,0,0}. Once you call SetBrowserView you can then set its bounds.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions