RAHUL DEV
RAHUL DEV

Reputation: 36

electron app always placed at the top with full-width and other windows should be placed under it

I am facing an issue. I need my electron app always placed at the top with full-width and other windows should be placed under it. How can I do this? anyone can help me to solve this issue?

Upvotes: 1

Views: 1672

Answers (1)

Mayank Vadiya
Mayank Vadiya

Reputation: 1451

You should use mainWindow.maximize() to display full width screen.

function createWindow() {
    // Create the browser window.
    mainWindow = new BrowserWindow({
        width: 1366,
        height: 783,
        alwaysOnTop:true //display show on top
    })
    // and load the index.html of the app.
    mainWindow.loadFile('index.html');


    // Emitted when the window is closed.
    mainWindow.on('closed', function () {
        mainWindow = null
    })
    mainWindow.maximize() //call like this way 
}

You can get more reference from here

Upvotes: 1

Related Questions