Skip to content

Transparency not working when using BaseWindow on Ubuntu (using Xorg) #50535

Closed

Description

@ECRomaneli

Preflight Checklist

Electron Version

41.0.4

What operating system(s) are you using?

Ubuntu

Operating System Version

Ubuntu 24.04.2 - Linux {username} 6.17.0-19-generic #19~24.04.2-Ubuntu SMP PREEMPT_DYNAMIC Fri Mar 6 23:08:46 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

What arch are you using?

x64

Last Known Working Electron version

41.0.3

Does the issue also appear in Chromium / Google Chrome?

No

Expected Behavior

Transparent window

Actual Behavior

Transparency is not working

Testcase Gist URL

Not able to create the fiddle right now, but there is a code example in the additional information.

Additional Information

Confirmed that the transparency is working when using BrowserWindow.

package.json

{
  "name": "transparency-bug",
  "version": "1.0.0",
  "private": true,
  "main": "main.js",
  "scripts": {
    "start": "electron ."
  },
  "devDependencies": {
    "electron": "=41.0.4"
  }
}

main.js

const { app, BaseWindow, WebContentsView } = require('electron');

function createWindow() {
  const win = new BaseWindow({ width: 800, height: 600, transparent: true, frame: false });
  const view = new WebContentsView();
  win.contentView.addChildView(view);
  view.setBounds({ x: 0, y: 0, width: 800, height: 600 });
  view.webContents.loadURL('data:text/html;charset=utf-8,' + encodeURIComponent(`<!doctype html><html><head><style>body{height:100%;margin:0;background:rgba(1,1,1,.5);}</style></head><body></body></html>`));
}

app.whenReady().then(createWindow);
app.on('window-all-closed', app.quit);

A frameless window is not required but it is easier to notice the issue.

Activity

  1. added theissue type on Mar 27, 2026
  2. moved this to 👀 Unsorted Items in 41-x-yon Mar 27, 2026
  3. mitchchn commented on Mar 27, 2026

    @mitchchn
    Member

    Probably the same cause as #50536.

  4. added
    bug/regression ↩️
    on Mar 27, 2026
  5. moved this from 👀 Unsorted Items to 🛠️ Fixed for Next Release in 41-x-yon Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

41-x-ybug 🪲bug/regression ↩️component/BaseWindowhas-repro-commentplatform/linux

Type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions