Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Overlay items flicker when near the edge of the window #8295

Closed

Description

@ssfrr

This happens frequently when using the Hydrogen package, which displays the return values from evaluated code as overlays on the window. It seems to be exacerbated when there are more overlays. It looks like the layout engine is trying to figure out where to render them but the act of rendering changes the location solution, so they start flickering like crazy.

Originally filed as an issue on Hydrogen: nteract/hydrogen#93, but it seems this is an issue with the Atom rendering.

Activity

  1. izuzak commented on Aug 10, 2015

    @izuzak
    Contributor

    @ssfrr Just to make sure we have all the relevant information -- can you please record a short GIF which clearly demonstrates the problem, and also provide the exact steps which reproduce this for you (+ version of Atom and OS)?

  2. ssfrr commented on Aug 12, 2015

    @ssfrr
    Author

    This gif doesn't really capture the speed of the flicker (it's very fast). Video is here (and even that seems slower then it looks on my screen).

    atom_flicker

    I'm on OSX, using Atom 1.0.5.

    It seems to take a while to reproduce, and seems to be exacerbated when I have a lot of overlay items, which happens commonly after working in Hydrogen for a while. Unfortunately I don't have a specific sequence of steps, but if I start to see some commonalities I'll post back.

  3. simurai commented on Aug 12, 2015

    @simurai
    Contributor

    I couldn't get the Hydrogen package to install, but based on the video, it looks like some GPU layer issue.

    If you're familiar with the DevTools, you could try to "Inspect Elements" and see what class that overlay has. It might be .hydrogen.output-bubble. If so, here some random things you can add to your styles.less and see if it helps.

    // uncomment only one line at the time, not all together
    
    .hydrogen.output-bubble,
    atom-text-editor::shadow .hydrogen.output-bubble {
      //backface-visibility: hidden;
      //z-index: 0; // also try increasing the number by one: 1, 2, 3 etc.
      //will-change: transform;
    }
    
    atom-text-editor {
      //overflow: hidden; // this might cause autocomplete to be cut off
    }
  4. izuzak commented on Aug 12, 2015

    @izuzak
    Contributor

    Thanks, @ssfrr.

    @nathansobo Does the behavior shown in the GIF above ring any 🔔 for you? EDIT: just noticed that @benogle added the atom label to this, sorry!

  5. ssfrr commented on Aug 12, 2015

    @ssfrr
    Author

    Here's what I see in the inspector. This was without any visible flickering on the screen, and no motion (scrolling or cursor movements) happening.
    inspector_flickering

    Also my CPU was pegged at 100% while I had the inspector open.

  6. ssfrr commented on Aug 12, 2015

    @ssfrr
    Author

    @simurai the hydrogen output-bubble div is a child of the atom-overlay element, which is what seems to be flickering. I did try your suggestions though and did not see any change. After I made the changes I just saved my styles.less file and switched tabs back to the document with the flickering.

    I also tried applying the styles to the atom-overlay element type as in:

    atom-overlay {
      // backface-visibility: hidden;
      z-index: 1; // also try increasing the number by one: 1, 2, 3 etc.
      // will-change: transform;
    }

    will-change had no effect. z-index had no effect for z-index > 0, if z-index == 0 the bubbles disappear entirely.
    backface-visibility had no effect.

  7. simurai commented on Aug 13, 2015

    @simurai
    Contributor

    @ssfrr Thanks for testing.

    Ok, based on the gif of the DevTools, it's not a GPU rendering issue, but rather the top position of the atom-overlay keeps getting updated for no reason.

  8. ssfrr commented on Aug 14, 2015

    @ssfrr
    Author

    Sounds like a good clue 🔍. Let me know if there's anything else I can test to get you more info.

  9. nilshg commented on Aug 26, 2015

    @nilshg

    Just to add that this is also a problem with the atom-julia-client package, where both results (Arrays resulting from computations) and autocomplete suggestions display this issue.

  10. as-cii commented on Dec 15, 2015

    @as-cii
    Contributor

    Could you tell whether this was fixed in the recent versions? We have made a couple of changes in the way we position elements since this was first opened and I wonder if they have had any positive impact on this bug. If not, could you provide some reproduction steps so that I can jump on this?

    Thanks!

  11. benogle commented on Dec 15, 2015

    @benogle
    Contributor

    I can reproduce this in ac+ when it's near the left of the window. This might be an issue with ac+ as it uses margin to adjust the left to line up the beginning of the words:

    ac flicker
    It's hard to capture with the gif as it's skipping frames...

    • close treeview and anything in the left panel
    • type atom. and type some atom global that would complete like clip
  12. as-cii commented on Dec 16, 2015

    @as-cii
    Contributor

    So, I can reproduce the above issue and have successfully debugged it. 🔎 It's caused by autocomplete-plus changing SuggestionListElement after reading UI properties, as you suggested. So, basically here's what's happening under the hood:

    1. The user presses a keystroke, causing SuggestionListElement to render new elements.
    2. A "poll after next update" is scheduled. (Poll 1)
    3. A document update is scheduled. (Update 1)
    4. A document read is scheduled. (Read 1)
    5. Update 1 is served and the overlay contents changed.
    6. Read 1 is served

      a) Some DOM properties are read

      b) A new document update is scheduled (Update 2)
    7. Poll 1 is served and overlays are measured. This causes a new update to TextEditorComponent be scheduled (Update 3)
    8. Update 2 is served and overlays are changed to adjust the margin.
    9. Update 3 is served, but overlays won't have the latest changes caused by Update 2 because they won't be measured until the next document poll or read, which will happen on the next frame. (Flicker!)

    A PR is on the way to atom/autocomplete-plus, but I am curious if the other packages mentioned on this issue are experiencing the same problem.

    @ssfrr @nilshg: is there a way I can consistently trigger that behavior on your packages? I am trying to find commonalities between the AC+ flicker and the ones you're experiencing so that we could (maybe) provide a more holistic solution.

    Thanks! ✨

  13. 6 remaining items

  14. jeremyfa commented on Jul 1, 2016

    @jeremyfa

    Having the same issue on atom 1.8.0, on OS X El Capitan. The issue occurs with autocomplete-plus, but also any cursor marker decoration of overlay type: atom/autocomplete-plus#738

    Any update on this issue?

  15. ypresto commented on Aug 5, 2016

    @ypresto
    Contributor

    PR is here..! #11388

  16. nathansobo commented on Aug 6, 2016

    @nathansobo
    Contributor

    This will be fixed in 1.9.6 thanks to @ypresto! ❤️ ⚡

  17. jeremyfa commented on Aug 7, 2016

    @jeremyfa

    The flickering issue is still happening on atom 1.9.6. I am not sure if what @ypresto fixed is the problem mentioned here initially. It seems that the problem he had (seeing his capture) is not the flickering issue described by @ssfrr .

    On my side, I have the exact same problem as @ssfrr as he described here one year ago.

    Please tell me if there is any other information I can provide to help get this fixed, as this is a rather annoying bug (like anything flickering on the screen when calmly writing code :( )

  18. ypresto commented on Aug 7, 2016

    @ypresto
    Contributor

    I experienced similar behavior to this (position of overlay continuously being changed in inspector) #8295 (comment)
    So I thought this is same issue of mine, but it can be separated issue if it is not solved.

  19. ypresto commented on Sep 9, 2016

    @ypresto
    Contributor

    Still experiencing related issue:

    1. Install merge-conflicts on Atom 1.10.1
    2. Execute merge-conflicts:detect command
    3. Open or change tab to Project Find Results
    4. Back to conflict-detected file
    5. Overlay slowly shrinks from outside of left edge, then stop at correct position

    (Show tree-view before step 3 for easy reproduction)

  20. ypresto commented on Sep 13, 2016

    @ypresto
    Contributor

    While I could not reproduce, flickering issue similar to one @ssfrr reported happened (in 1.10.1, probably).
    Only happened on bottom of window.

    atom-bug-flicker

    (Low fps; it was much more faster than this gif.)

  21. nathansobo commented on Sep 22, 2016

    @nathansobo
    Contributor

    @ypresto @jeremyfa Could you let us know what themes you are using? We're having trouble reproducing.

  22. Ben3eeE commented on Oct 12, 2016

    @Ben3eeE
    Contributor

    I can get the autocomplete box to flicker when resizing panes but not without doing anything.

    flicker autocomplete 2

  23. nathansobo commented on Oct 14, 2016

    @nathansobo
    Contributor

    Closed via #12977.

  24. lock commented on Apr 4, 2018

    @lock

    This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!

  25. locked and limited conversation to collaborators on Apr 4, 2018
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