Try to create BrowserWindow with current desktop resolution (ex. in my case it's 1920x1080) or greater than the current desktop resolutin. The window's size is 1920x1040 (40px is probably the taskbar space). Changing enableLargerThanScreen to true, max width/height to current resolution or greater does nothing.
My BrowserWindow creator: (I want to create transparent fullscreen borderless window - fullscreen overlay)
capture = new BrowserWindow({
enableLargerThanScreen: true,
x: 0,
y: 0,
width: 1920,
height: 1080,
frame: false,
transparent: true,
resizable: false,
maxHeight: 1080,
maxWidth: 1920,
'skip-taskbar': true,
alwaysOnTop: true,
hasShadow: false
});
What do you mean by "doesn't work"?
As the documentation says, the enableLargerThanScreen option should "Enable the window to be resized larger than screen". It doesn't work for me (I was trying to create window larger than my screen resolution with more than 1920px in width and more than 1080px in height) and the result was only a 1920x1040px window.
I understand the problem now, on Windows there is a platform limitation that you can not create a window larger than the display, but you can resize the window to any size you want. So passing the window size to BrowserWindow
won't work, but you can call setSize
instead:
capture.setSize(1920, 1080);
Most helpful comment
I understand the problem now, on Windows there is a platform limitation that you can not create a window larger than the display, but you can resize the window to any size you want. So passing the window size to
BrowserWindow
won't work, but you can callsetSize
instead: