Skip to content

Closing detach devtools disables browser window transparency/vibrancy #10420

Closed

Description

@KagamiChan
  • Electron version: 1.8.0 beta
  • Operating system: macOS 10.12.6

Expected behavior

Browser window's vibrancy settings persists after closing detached devtools

Actual behavior

Closing detached devtools will disable browser window's vibrancy, and calling setVibrancy again can't re-enable it.

sep-01-2017 14-04-05

How to reproduce

The repo for reproducing is https://github.com/KagamiChan/electron-quick-start in branch 1.8.0-vibrancy-mac. I simply added these lines in renderer.js

const { remote } = require('electron')

const win = remote.getCurrentWindow()
win.setVibrancy('ultra-dark')

win.webContents.openDevTools({mode: 'detach'})

win.webContents.on('devtools-closed', () => {
  setTimeout(() => {
    console.log('restoring vibrancy')
    win.setVibrancy('ultra-dark')
  }, 1000)
})

Steps to reproduce:

  1. git clone -b 1.8.0-vibrancy-mac https://github.com/KagamiChan/electron-quick-start
  2. cd electron-quick-start && npm i && npm run start
  3. Close the detached devtools
  4. the browser window loses vibrancy

btw, In previous version (1.7.5), non-detached devtools breaks the vibrancy but then it will restore after closing the devtools, and in 1.8.0 the vibrancy does not come back either.

Activity

  1. changed the title [-][Bug][1.8.0] Closing detach devtools disables browser window vibrancy on macOS[/-] [+][macOS][1.8.0] Closing detach devtools disables browser window vibrancy on macOS[/+] on Sep 6, 2017
  2. KagamiChan commented on Sep 12, 2017

    @KagamiChan
    ContributorAuthor

    Could someone give me a hint on how to fix this?

  3. gerhardberger commented on Sep 16, 2017

    @gerhardberger
    Contributor

    the problem is when closing the devtools a new render view is created and because there is no background color specified it defaults to white.

    one solution would be to change this default color to transparent, since I don't see, if it is particularly important here to use white (in some other place there is transparent default color), but there could be a reason.

    but to solve it without code change, use a clear color as your BrowserWindow's background color, e.g.:

    mainWindow = new BrowserWindow({
      width: 800,
      height: 600,
      backgroundColor: '#00000000'
    })
  4. KagamiChan commented on Sep 18, 2017

    @KagamiChan
    ContributorAuthor

    @gerhardberger Thank you for looking into this. Setting background color works like a charm.
    But I think this is still a bug since the behavior is inconsistent across versions

  5. removed their assignment
    on Oct 2, 2017
  6. 15 remaining items

  7. Eugeny commented on Sep 24, 2019

    @Eugeny

    Still the case with 6.0.10

  8. 0xdeafcafe commented on Nov 15, 2020

    @0xdeafcafe

    Bumping as this still happens on 10.1.5

  9. rrroyal commented on May 2, 2021

    @rrroyal

    Still happens on 11.4.3 :/

  10. kysubay commented on May 26, 2021

    @kysubay

    when I use multiple browsers View and close the devtools on any browser shows a white window. I don't know if it's like you

  11. codebytere commented on Jul 27, 2022

    @codebytere
    Member

    This no longer happens as of v16 - so all supported versions now work correctly. Closing this out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions