Skip to content

Instantly share code, notes, and snippets.

@JUNKI555
Created December 20, 2021 16:19
Show Gist options
  • Save JUNKI555/1719ffbc71645f4082718c082a969a51 to your computer and use it in GitHub Desktop.
Save JUNKI555/1719ffbc71645f4082718c082a969a51 to your computer and use it in GitHub Desktop.
Electron resizable false maximize window current Display
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