Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

X11 xorg Electron App cant open in fullscreen

We have an electron app running on X11 without a Window Manager -> directly on the XServer.

We can't get electron to get in fullscreen!

main.js

const { app, BrowserWindow } = require('electron')

let win;

function createWindow () {
    // Create the browser window.
    win = new BrowserWindow({
        width: 400,
        height: 300,
        backgroundColor: '#ffffff',
        fullscreen:true,
        "web-preferences": { "web-security": false }
        //icon: `file://${__dirname}/dist/assets/logo.png`
    })


    win.loadFile(`app/index.html`)

    //// uncomment below to open the DevTools.
    win.webContents.openDevTools()

    // Event when the window is closed.
    win.on('closed', function () {
        win = null
    })
}

// Create window on electron intialization
app.on('ready', createWindow)

We also tried using setFullscreen, nothing works.

The xserver uses the whole screen, so there's no problem with it. Chromium started in fullscreen - no problems. The screen

If we start Electron with an Window Manager, we can press F11 afterwards to make it full size but still doesn't work programmaticly

We tried:

  • Setting the width and height with the resolution from the screen itself in the BrowserWindow Constructor.
  • Setting Kiosk with .setKiosk(true) and in options kiosk: true
  • Setting Fullscreen with .setFullscreen(true) and fullscreen: true
like image 289
filip Avatar asked Oct 28 '25 00:10

filip


1 Answers

This might not be what you want but there is a option called kiosk this is basically fullscreen mode exept the page covers the entire screen. Also you can't escape from it until kiosk mode is turned off.

To activate you can either call setKiosk(true). Or set kiosk: true in the browser window options

setKiosk Docs.

like image 115
Joshua Avatar answered Oct 30 '25 16:10

Joshua