electron: [Bug]: Can't resize BrowserWindow from the bottom edge when it's been shrunk down to the minimum height with a BrowserView inside of it
Preflight Checklist
- I have read the Contributing Guidelines for this project.
- I agree to follow the Code of Conduct that this project adheres to.
- I have searched the issue tracker for a feature request that matches the one I want to file, without success.
Electron Version
16.0.5
What operating system are you using?
Windows
Operating System Version
Windows 10
What arch are you using?
x64
Last Known Working Electron version
n/a
Expected Behavior
I have a BrowserView inside of a BrowserWindow. The BrowserView is offset by a number of pixels from the top, and the BrowserWindow’s minimum height is set to that number of pixels (so I can shrink the window down to the height of the BrowserWindow section that’s not part of the BrowserView [like a custom toolbar]).
If I resize the window to the minimum height, I expect to be able to resize the window by dragging from the bottom side of the window.
Actual Behavior
If I resize the window to the minimum height, I can’t resize it anymore by dragging from the bottom side of the window. I have to resize from the corner.
Testcase Gist URL
https://gist.github.com/2b49e6725aff2d6cb3cf5bc126f42add
Additional Information
I can work around this by setting the minimum height to 1 pixel more than the height of the titlebar/BrowserWindow section.
main.js:
(async () => {
const { app, BrowserWindow, BrowserView } = require("electron");
app.on("window-all-closed", async () => {
app.quit();
});
await app.whenReady();
const mainWindow = new BrowserWindow();
mainWindow.removeMenu();
mainWindow.setMinimumSize(0, 50 + (mainWindow.getSize()[1] - mainWindow.getContentBounds().height));
await mainWindow.loadFile("./index.html");
const bv = new BrowserView();
bv.setBounds({ x: 0, y: 50, width: mainWindow.getContentBounds().width, height: mainWindow.getContentBounds().height });
bv.setAutoResize({ width: true, height: true });
await bv.webContents.loadURL("https://google.com");
mainWindow.setBrowserView(bv);
})();
index.html:
<body style="background-color:blue">
<h1>Hello World!</h1>
</body>

About this issue
- Original URL
- State: open
- Created 5 years ago
- Comments: 24 (5 by maintainers)
bump
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, “bump”), and we’ll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!