Created
December 20, 2021 16:19
-
-
Save JUNKI555/1719ffbc71645f4082718c082a969a51 to your computer and use it in GitHub Desktop.
Electron resizable false maximize window current Display
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { BrowserWindow, screen } = require('electron') | |
const createWindow = () => { | |
// get current display | |
const targetDisplay = screen.getDisplayNearestPoint(screen.getCursorScreenPoint()) | |
// set resizable maximize | |
// show more | |
// https://github.com/electron/electron/issues/19934 | |
// https://stackoverflow.com/questions/50213126/how-to-create-a-non-resizable-and-100-screen-not-full-screen-browserwindow | |
const transparentWindow = new BrowserWindow({ | |
x: targetDisplay.workArea.x, | |
y: targetDisplay.workArea.y, | |
width: targetDisplay.workArea.width, | |
height: targetDisplay.workArea.height, | |
transparent: true, | |
frame: false, | |
resizable: false, | |
alwaysOnTop: true | |
}) | |
transparentWindow.loadFile('index.html') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment