Skip to content

disableHardwareAcceleration with transparency causes BrowserWindow not to show #10678

Closed

Description

@ahallicks

Versions

  • Electron version: v1.8.1
  • Operating system: Windows 10

Expected behavior

The same as with v1.7.8, the BrowserWindow opens correctly and you can see it and interact with it with no errors in the console.

Actual behavior

The BrowserWindow is there but you can't see it or interact with it. It appears to be something to do with the app.disableHardwareAcceleration(); coupled with setting transparent to true on the BrowserWindow. If I remove both of those it works okay.

How to reproduce

I've created an example here:
https://github.com/ahallicks/electron-example

git clone https://github.com/ahallicks/electron-example.git
npm i
npm start

On a related note

I've also had some other issues relating to this with an app I've been working on for the last year. Up until v1.8.1 it has worked great and I use transparency to make it look more 'app like' (by adding my own shadows and styles in CSS).

With v1.8.1 I couldn't get the app to show (because of the above) but I have also been getting all kinds of errors to do with the GPU:

[42468:0929/173406.169:VERBOSE1:CONSOLE(8160)] "Main._createAppUI: 24.455078125ms", source: chrome-devtools://devtools/bundled/inspector.js (8160)
[42468:0929/173406.169:VERBOSE1:CONSOLE(8160)] "Main._createAppUI: 38.053955078125ms", source: chrome-devtools://devtools/bundled/inspector.js (8160)
[42468:0929/173406.219:VERBOSE1:CONSOLE(8165)] "Main._showAppUI: 20.02587890625ms", source: chrome-devtools://devtools/bundled/inspector.js (8165)
[42468:0929/173406.219:VERBOSE1:CONSOLE(8165)] "Main._showAppUI: 19.537109375ms", source: chrome-devtools://devtools/bundled/inspector.js (8165)
[42468:0929/173406.222:VERBOSE1:CONSOLE(8166)] "Main._initializeTarget: 13.885009765625ms", source: chrome-devtools://devtools/bundled/inspector.js (8166)
[42468:0929/173406.222:VERBOSE1:CONSOLE(8166)] "Main._initializeTarget: 13.93896484375ms", source: chrome-devtools://devtools/bundled/inspector.js (8166)
[53816:0929/173407.807:ERROR:gpu_child_thread.cc(174)] Exiting GPU process due to errors during initialization
[207424:0929/173407.914:ERROR:gpu_child_thread.cc(174)] Exiting GPU process due to errors during initialization
[161948:0929/173407.996:ERROR:gpu_child_thread.cc(174)] Exiting GPU process due to errors during initialization
[42468:0929/173408.683:VERBOSE1:CONSOLE(8160)] "Main._createAppUI: 22.083984375ms", source: chrome-devtools://devtools/bundled/inspector.js (8160)
[42468:0929/173408.712:VERBOSE1:CONSOLE(8165)] "Main._showAppUI: 14.362060546875ms", source: chrome-devtools://devtools/bundled/inspector.js (8165)
[42468:0929/173408.734:VERBOSE1:CONSOLE(8166)] "Main._initializeTarget: 9.392822265625ms", source: chrome-devtools://devtools/bundled/inspector.js (8166)
[21216:0929/173415.389:FATAL:partition_alloc.cc(934)] Check failed: page->num_allocated_slots != -1.
Backtrace:
        GetHandleVerifier [0x00007FF6F2F12475+25013]
        GetHandleVerifier [0x00007FF6F2F84913+493139]
        (No symbol) [0x00007FF6F2F09944]
        IsSandboxedProcess [0x00007FF6F5EF419D+46695797]
        IsSandboxedProcess [0x00007FF6F4E768CB+29404323]
        v8::internal::OptimizingCompileDispatcher::Unblock [0x00007FFBE834C847+1831]
        v8::internal::OptimizingCompileDispatcher::Unblock [0x00007FFBE834CB62+2626]
        v8::internal::AllocationSpaceName [0x00007FFBE82F5218+13784]
        v8::internal::AllocationSpaceName [0x00007FFBE82FCB91+44881]
        v8::internal::Builtins::WasmStackGuard [0x00007FFBE82ECA57+50967]
        v8::internal::AllocationSpaceName [0x00007FFBE82F56CE+14990]
        v8::internal::AllocationSpaceName [0x00007FFBE82F490B+11467]
        v8::internal::AllocationSpaceName [0x00007FFBE82F3B5E+7966]
        v8::internal::OptimizingCompileDispatcher::IsQueueAvailable [0x00007FFBE7FF5929+2745]
        v8::internal::ScavengeJob::NotifyIdleTask [0x00007FFBE7FF7075+1781]
        v8::internal::GCTracer::AddScopeSample [0x00007FFBE7FE90D0+13872]
        v8::internal::GCTracer::AddScopeSample [0x00007FFBE7FE8DAA+13066]
        v8::internal::OptimizingCompileDispatcher::Enabled [0x00007FFBE7FF09F0+3456]
        v8::internal::interpreter::Bytecodes::ToString [0x00007FFBE832D90C+2940]
        GetHandleVerifier [0x00007FF6F2FB35E8+684840]
        IsSandboxedProcess [0x00007FF6F54C3E54+36012588]
        IsSandboxedProcess [0x00007FF6F54C2BAF+36007815]
        IsSandboxedProcess [0x00007FF6F54C062D+35998213]
        GetHandleVerifier [0x00007FF6F2FB35E8+684840]
        GetHandleVerifier [0x00007FF6F2F54656+295830]
        GetHandleVerifier [0x00007FF6F2F53140+290432]
        GetHandleVerifier [0x00007FF6F2FB5623+693091]
        GetHandleVerifier [0x00007FF6F2F506BE+279550]
        IsSandboxedProcess [0x00007FF6F39C42DF+7702199]
        IsSandboxedProcess [0x00007FF6F360EC1D+3813365]
        IsSandboxedProcess [0x00007FF6F360EB14+3813100]
        IsSandboxedProcess [0x00007FF6F475756A+21936450]
        GetHandleVerifier [0x00007FF6F3016DE0+1092384]
        (No symbol) [0x00007FF6F2C5AAF7]
        IsSandboxedProcess [0x00007FF6F5ED8A4B+46583331]
        BaseThreadInitThunk [0x00007FFC34EB2774+20]
        RtlUserThreadStart [0x00007FFC37240D51+33]

Even with the app.disableHardwareAcceleration(); removed I would randomly get the above when moving, minimising or maximising BrowserWindows. However, I couldn't get the errors above to replicate with the quickstart demo in the repository above despite copying all sorts of bits and pieces from my main app to the test one.

Activity

  1. welcome commented on Oct 3, 2017

    @welcome

    👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

    To help make it easier for us to investigate your issue, please follow the contributing guidelines.

  2. added
    bug/regression ↩️
    and removed on Oct 23, 2017
  3. jkleinsc commented on Oct 23, 2017

    @jkleinsc
    Member

    I can reproduce this issue with the given example. Tested with 1.8.2.beta.1 and the issue exists there as well. The issue isn't present in 1.7.9

  4. removed their assignment
    on Oct 23, 2017
  5. edunad commented on Jan 3, 2018

    @edunad

    Same issue on v1.8.2-beta.3

  6. brenca commented on Jan 10, 2018

    @brenca
    Contributor

    @zcbenz Do you know why this comment is here?
    Removing that style from the window fixes this issue. In the chromium source code the only thing I found was a DCHECK here, which checks that this flag is not present, if I'm reading this correctly.

  7. zcbenz commented on Jan 23, 2018

    @zcbenz
    Contributor

    @brenca I believe it was only for transparent window, but after some code refactors we lost that condition.

    It was initially added at 1a34e09.

  8. zcbenz commented on Jan 23, 2018

    @zcbenz
    Contributor

    I don't remember why it needed to be there for transparent window though, I probably just followed some Chromium code, and it is not used in Chromium anymore.

  9. brenca commented on Jan 23, 2018

    @brenca
    Contributor

    Looks like it was removed in chromium here. Shall I post a PR removing that style?

  10. zcbenz commented on Jan 23, 2018

    @zcbenz
    Contributor

    @brenca I'm 👍 removing it.

  11. felixrieseberg commented on Feb 1, 2018

    @felixrieseberg
    Member

    Uhhh.... What you're seeing here is a transparent window being enabled and disabled. Notice the titlebar.

    html notifications

  12. brenca commented on Feb 1, 2018

    @brenca
    Contributor

    @felixrieseberg Can you give me a small repro code of this? I'm gonna take a look at it tomorrow.

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