Repository navigation
Description
Preflight Checklist
- I have read the Contributing Guidelines for this project.
- I agree to follow the Code of Conduct that this project adheres to.
- I have searched the issue tracker for a feature request that matches the one I want to file, without success.
Electron Version
16.0.0
What operating system are you using?
Other (specify below)
Operating System Version
Windows 11, macOS 12, Fedora 35
What arch are you using?
Other (specify below)
Last Known Working Electron version
11.5.0
Expected Behavior
A hidden window with this configuration should still paint:
const mainWindow = new BrowserWindow({
width: 800,
height: 600,
show: false,
paintWhenInitiallyHidden: true,
})The page should fire paint events that can be picked up by PerformanceObserver.
const observer = new PerformanceObserver((performance) => {
console.log("Paint event:", performance.getEntries(), new Date().toString());
});
observer.observe({ entryTypes: ["paint"] });Actual Behavior
On Windows and Linux, paint events do not fire while the window is hidden. It is unclear whether any painting is happening while the window is hidden.
On macOS, it works as expected.
Windows console output in renderer:
Contentful element added to DOM: <h1>Paint me!!</h1>
Showing window after timeout: Thu Nov 25 2021 13:26:28 GMT-0500 (Eastern Standard Time)
Paint event: Array(2) Thu Nov 25 2021 13:26:28 GMT-0500 (Eastern Standard Time)
Mac console output in renderer:
Contentful element added to DOM: <h1>Paint me!!</h1>
Paint event: Array(2) Thu Nov 25 2021 13:25:10 GMT-0500 (Eastern Standard Time)
Showing window after timeout: Thu Nov 25 2021 13:25:13 GMT-0500 (Eastern Standard Time)
Testcase Gist URL
Additional Information
This behaviour seemed to regress gradually over the course of several Electron versions. In 11.x, the paint events reliably fire when the window is hidden. Around 13-14, they sometimes do, and sometimes do not. As of 16.0, they never fire on Windows or Linux, but continue to fire on macOS.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fields👍 Does Not Block Stable
- StatusShow more project fields👍 Does Not Block Stable
Activity
github-actions commentedon Oct 5, 2022
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!
github-actions commentedon Nov 6, 2022
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.
pushkin- commentedon Nov 28, 2022
I think this is still an issue in Electron 21
fanchenio commentedon Feb 17, 2023
Indeed, for example, when I want to hide the window, I want to clear the content of the input box on the html, but when the window is hidden, after sending a message to the page through contents.send, it will not take effect immediately, but will take effect after the window is displayed.
github-actions commentedon May 19, 2023
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!
pushkin- commentedon May 19, 2023
bump
30 remaining items
nikwen commentedon Apr 10, 2025
I believe this comment explains what broke this in Electron v35 on macOS: #46602 (comment)
nikwen commentedon Feb 10, 2026
I ran into this while working on #49706.