[Bug]: Disabling `backgroundThrottling` not working with hide() on Windows · Issue #31016 · electron/electron · GitHub
Skip to content

[Bug]: Disabling backgroundThrottling not working with hide() on Windows #31016

Closed

Description

@aluo-lmi

Preflight Checklist

Electron Version

14.0.0

What operating system are you using?

Windows

Operating System Version

Windows 10 build 19041.1165

What arch are you using?

x64

Last Known Working Electron version

No response

Expected Behavior

On Windows, setting backgroundThrottling: false on a BrowserWindow should cause throttling of things like requestAnimationFrame to not happen when the window is occluded, minimized, or hidden.

Actual Behavior

On Windows, setting backgroundThrottling: false on a BrowserWindow causes throttling of things like requestAnimationFrame to not happen when the window is occluded or minimized but not hidden. On MacOS (v11.5.2 Intel x64) disabling backgroundThrottling causes requestAnimatingFrames to continue to work for all 3 cases -- occluded, minmized, and hidden. This is the reason I think this might be a bug on Windows.

Testcase Gist URL

https://gist.github.com/aluo-lmi/e8be4e6f23f5eca831fad332a810f99f

Additional Information

Steps for repro on gist:

  1. Start gist in electron (fiddle), open dev console and pop it out -> observe the tick being logged twice per second as callbacks to requestAnimationFrame calls
  2. Occlude the window, minimize the window, or click Hide for 5s -> observe the tick stops being logged in all 3 cases
  3. Click Toggle background throttling button
  4. Occlude or minimize the window -> observe the tick does not stop being logged
  5. Click Hide for 5s -> On Windows, observe the tick stops being logged during the 5s the window is hidden, indicating the requestAnimationFrame callbacks are being blocked. On Mac, observe the tick continue to be logged indicating they are not.

Activity

  1. zeeker999 commented on Sep 18, 2021

    @zeeker999
    Contributor

    the root cause likely is the same as issue #30666

  2. bavulapati commented on Jan 18, 2022

    @bavulapati
    Contributor

    Noticed this on v15.3.5 and v16.0.7 too

  3. ahadcove commented on Feb 28, 2022

    @ahadcove

    Has anyone found a solution for this?
    Seems to still be around on windows

  4. kriswest commented on Apr 6, 2022

    @kriswest

    We noticed this on v16.2.0 as well

  5. github-actions commented on Oct 5, 2022

    @github-actions
    Contributor

    This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

  6. github-actions commented on Nov 6, 2022

    @github-actions
    Contributor

    This issue has been closed due to inactivity, and will not be monitored. If this is a bug and you can reproduce this issue on a supported version of Electron please open a new issue and include instructions for reproducing the issue.

  7. pushkin- commented on Nov 28, 2022

    @pushkin-

    I can repro this on Windows in Electron 21

  8. 17 remaining items

  9. 2573825854 commented on Jun 15, 2024

    @2573825854

    29.4.2中仍然有该问题

  10. sahil-lalani commented on Aug 26, 2024

    @sahil-lalani

    bump

  11. NoRabbit commented on Oct 28, 2024

    @NoRabbit

    bump -> 31.2.0

  12. qian-jiang commented on Nov 4, 2024

    @qian-jiang

    Recurrence in version 31

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