Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BrowserWindow#setBackgroundColor doesn't work #26842

Closed
fabiospampinato opened this issue Dec 6, 2020 · 8 comments
Closed

BrowserWindow#setBackgroundColor doesn't work #26842

fabiospampinato opened this issue Dec 6, 2020 · 8 comments
Labels
11-x-y 12-x-y 13-x-y 14-x-y bug 🪲 platform/macOS status/confirmed A maintainer reproduced the bug or agreed with the feature
Projects

Comments

@fabiospampinato
Copy link
Contributor

fabiospampinato commented Dec 6, 2020

Issue Details

  • Electron Version:
    • 11.0.3
  • Operating System:
    • macOS 10.14
  • Last Known Working Electron version:
    • N/A

Expected Behavior

It should work.

Actual Behavior

It doesn't do anything, as far as I can tell. When resizing the window like a lunatic actually sometimes you can kind of see the new background color, but it's as if it's applied only to the portion of the window the app doesn't occupy yet.

By the way vibrancy isn't working for me either, perhaps the two issues are related.

To Reproduce

Fiddle: https://gist.github.com/753fe49cec47bfa46e06cd77d16053b0

@zcbenz zcbenz added this to Unsorted Issues in 12-x-y Dec 9, 2020
@sofianguy sofianguy moved this from Unsorted Issues to Does Not Block Stable in 12-x-y Dec 10, 2020
@jcarpenter
Copy link

jcarpenter commented Jan 14, 2021

Here's what I'm seeing (Electron 11.0.3, macOS 11.1)

  • Don't set backgroundColor: white background
  • Set background color to any value: black background. Have tried all sorts of values: 6-digit hex, 8-digit hex, even #FFF; nothing makes a difference. No difference between setting via new BrowserWindow({ backgroundColor: '#FFF' }), or win.setBackgroundColor.

Transparency and Vibrancy are off.

@charlag
Copy link

charlag commented Jun 9, 2021

For us it works the first time we set it but not afterwards. Both 11.4.0 and 12.0.10. getBaackgroundColor() returns new color but it's not actually applied.

@nornagon nornagon added 13-x-y 14-x-y status/confirmed A maintainer reproduced the bug or agreed with the feature labels Jun 18, 2021
@yarinsa
Copy link

yarinsa commented Sep 9, 2021

@nornagon @zcbenz @jcarpenter @fabiospampinato @charlag
Hey, I encountered the same issue, did any of you managed to solve it? From my experience with electron.js sometimes it could be unrelated flags that prevent some behaviors.

@fabiospampinato
Copy link
Contributor Author

I haven't looked into it again, whatever flag may or may not conflict with it I need it so I can't just toggle it to have the background color working.

@garrettm
Copy link

For us it works the first time we set it but not afterwards. Both 11.4.0 and 12.0.10. getBaackgroundColor() returns new color but it's not actually applied.

I'm seeing the same behavior @charlag -- though I am able to get one set to go through right after creating my browserWindow (maybe sets before show() go through?)

@bpasero
Copy link
Contributor

bpasero commented Sep 29, 2021

Confirmed also for VSCode.

//cc @deepak1556

@bpasero
Copy link
Contributor

bpasero commented Sep 29, 2021

I think this actually works starting with Electron 15 from my testing with a Fiddle.

@deepak1556
Copy link
Member

This is fixed by #30777, please check >=v14.0.1 or >=15.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
11-x-y 12-x-y 13-x-y 14-x-y bug 🪲 platform/macOS status/confirmed A maintainer reproduced the bug or agreed with the feature
Projects
No open projects
12-x-y
Does Not Block Stable
Development

No branches or pull requests

9 participants