electron: Frameless window height cannot be lower than 39 on Windows
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
15.1.2
What operating system are you using?
Windows
Operating System Version
Windows 10 Enterprise 1909
What arch are you using?
x64
Last Known Working Electron version
No response
Expected Behavior
Window height should be 25
Actual Behavior
Window height is 39
Testcase Gist URL
No response
Additional Information
const { app, BrowserWindow } = require('electron');
app.on('ready', () => {
const win = new BrowserWindow({
width: 400,
height: 25,
frame: false,
show: false,
thickFrame: false,
});
win.loadURL('https://github.com').then(() => {
win.webContents.executeJavaScript(
'document.body.innerHTML = innerHeight;' +
'document.body.style.boxShadow = "inset 0 0 0 1px lightblue";');
});
win.once('ready-to-show', () => {
win.show();
win.setSize(400, 25);
});
});
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 21 (14 by maintainers)
I found the following work around, which might work in my case https://github.com/electron/electron/issues/32302#issuecomment-1009776445
thanks! This works.
The work around I found is using setShape function of BrowserWindow and passing to it an array with the expected rectangle shape. https://www.electronjs.org/docs/latest/api/browser-window#winsetshaperects-windows-linux-experimental
@virtuecoder not using a proper title for your bug makes it much less likely to be noticed and fixed.