You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Page content resizes with noticable delay when layout is heavy #3615
When you have quite heavy layout with many elements, page content resizes with a delay when you resizing a window.
Let's look at this. For the demo I've created a page with 1000 fixed elements.
This is what happens when I'm resizing an Electron window:
I've also created a native cocoa app with a webview (which uses system Safari I guess) and it doesn't have this problem:
So I'm looking for some solution. I'm ready to dig into Electron code, patch something, maybe do some dirty hack, there must be something! If it's at all possible, please give me some hint of how to fix it.
What version of Electron are you using? There were some issues with resizing speed because Electron's windows were registering as "transparent regions" on Mac OS X, but I think that's been fixed in the latest builds.
@bengotow, Electron version is 0.35.2. The same happens on Windows. @etiktin it's the same, I think it's because Chrome resizes everything asynchronously, after the window was resized. But maybe there is a way to make it synchronous? I'm not an expert in libchromiumcontent, but someone must know.
The lag is really ugly if using a frameless window. A fix for this would be awesome.
It already happens if using an absolute div with "width: 100%" or flex-box
And like I said, if someone could give me a hint I could try to fix it myself. Maybe it's possible to do some hack, like wait for some 'resize-done' event from chromium and only after that actually resize a window... I don't know, there must be a way.
I can confirm this too, but just tested in Chrome and it's the same so I'm afraid there is not much we can do except wait for it to be fixed in Chromium :(
I don't think there is a way to make Chrome resize synchronously, the whole design of Chromium's rendering is to be asynchronous, and I'm pretty sure Chrome team won't bother adding it, so I'm closing this as won't fix. But if someone came up with a solution, I would be very happy to merge it.
I had the same problem, I used the command npm update electron-prebuilt -g and I don't have the problem anymore. I think it's due to Chrome 55 that has just been released.
Make sure you update for the package you used (if you used any).
I was trying different 'hax'es like sending dimensions on 'will resize' to renderer and modifying container size manually etc. Nothing seems to help.
This is especially ugly when you resize the window by dragging top edge of it, then bottom part of the content is jumping quickly until I stop resizing.
Latest Chrome version now syncs window and render sizes.
Screen.Recording.2021-08-14.at.08.17.12.mov
Yet still, if relayout takes a lot of time, this split still occurs, especially for more complex layouts and because chrome is not optimizing for relayout performance.
Activity
etiktin commentedon Nov 30, 2015
Can you run that code in Chrome and check how it performs compared to Electron?
bengotow commentedon Dec 1, 2015
What version of Electron are you using? There were some issues with resizing speed because Electron's windows were registering as "transparent regions" on Mac OS X, but I think that's been fixed in the latest builds.
evgenyzinoviev commentedon Dec 5, 2015
@bengotow, Electron version is 0.35.2. The same happens on Windows.
@etiktin it's the same, I think it's because Chrome resizes everything asynchronously, after the window was resized. But maybe there is a way to make it synchronous? I'm not an expert in libchromiumcontent, but someone must know.
levrik commentedon Dec 5, 2015
The lag is really ugly if using a frameless window. A fix for this would be awesome.
It already happens if using an absolute div with "width: 100%" or flex-box
evgenyzinoviev commentedon Dec 5, 2015
And like I said, if someone could give me a hint I could try to fix it myself. Maybe it's possible to do some hack, like wait for some 'resize-done' event from chromium and only after that actually resize a window... I don't know, there must be a way.
raleksandar commentedon Dec 5, 2015
I can confirm this too, but just tested in Chrome and it's the same so I'm afraid there is not much we can do except wait for it to be fixed in Chromium :(
zcbenz commentedon Dec 9, 2015
I don't think there is a way to make Chrome resize synchronously, the whole design of Chromium's rendering is to be asynchronous, and I'm pretty sure Chrome team won't bother adding it, so I'm closing this as won't fix. But if someone came up with a solution, I would be very happy to merge it.
abhishiv commentedon Jan 5, 2016
Will this help - https://code.google.com/p/chromium/issues/detail?id=531831
jbonnett92 commentedon Dec 20, 2016
I had the same problem, I used the command
npm update electron-prebuilt -gand I don't have the problem anymore. I think it's due to Chrome 55 that has just been released.Make sure you update for the package you used (if you used any).
pie6k commentedon Jun 9, 2020
Seems it's still an issue :<
I was trying different 'hax'es like sending dimensions on 'will resize' to renderer and modifying container size manually etc. Nothing seems to help.
This is especially ugly when you resize the window by dragging top edge of it, then bottom part of the content is jumping quickly until I stop resizing.
0x0blu commentedon Aug 14, 2021
Latest Chrome version now syncs window and render sizes.
Screen.Recording.2021-08-14.at.08.17.12.mov
Yet still, if relayout takes a lot of time, this split still occurs, especially for more complex layouts and because chrome is not optimizing for relayout performance.
CryUshio commentedon Nov 8, 2022
Reproduces with Electron 21.x. Any update?