Skip to content

Page content resizes with noticable delay when layout is heavy #3615

Closed

Description

@evgenyzinoviev

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:
resize-electron

I've also created a native cocoa app with a webview (which uses system Safari I guess) and it doesn't have this problem:
resize-webview-safari

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.

Activity

  1. etiktin commented on Nov 30, 2015

    @etiktin
    Contributor

    Can you run that code in Chrome and check how it performs compared to Electron?

  2. added
    blocked/need-info ❌
    on Nov 30, 2015
  3. bengotow commented on Dec 1, 2015

    @bengotow
    Contributor

    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.

  4. evgenyzinoviev commented on Dec 5, 2015

    @evgenyzinoviev
    Author

    @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.

  5. levrik commented on Dec 5, 2015

    @levrik
    Contributor

    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

  6. evgenyzinoviev commented on Dec 5, 2015

    @evgenyzinoviev
    Author

    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.

  7. raleksandar commented on Dec 5, 2015

    @raleksandar

    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 :(

  8. zcbenz commented on Dec 9, 2015

    @zcbenz
    Contributor

    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.

  9. added and removed
    blocked/need-info ❌
    on Dec 9, 2015
  10. jbonnett92 commented on Dec 20, 2016

    @jbonnett92

    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).

  11. pie6k commented on Jun 9, 2020

    @pie6k

    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.

  12. 0x0blu commented on Aug 14, 2021

    @0x0blu

    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.

  13. CryUshio commented on Nov 8, 2022

    @CryUshio

    Latest Chrome version now syncs window and render sizes.

    Reproduces with Electron 21.x. Any update?

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