New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest Atom on Windows 10 Regains focus with delay #13456

Closed
d4rkd0s opened this Issue Dec 15, 2016 · 9 comments

Comments

Projects
None yet
6 participants
@d4rkd0s

d4rkd0s commented Dec 15, 2016

Prerequisites

  • The issue is reproducible for me every time I want to use/open/focus Atom with a project open
  • I am running the latest stable version of Atom 1.12.7 on Windows 10 64-bit
  • I did debug as much as I could and have included the information below
  • I have checked the FAQ and found nothing of use related to this issue
  • This is being reported as an Atom core issue on the Atom/Atom repository.
  • I have searched and found other issues similar in nature but not exact to this issue, and was requested by a few members of the community to create this issue.

Description

When opening Atom for the first time, or when clicking off Atom to "lose focus" and then clicking back in to paste/type into Atom the application seems to hang for roughly 700-900ms (800ms on average). This is not only annoying to have to wait nearly a second to even use Atom but its gotten to the point where myself and a few other community members have switched to alternative editors whilst this is being fixed.

I have cleared out everything imaginable on my system to "Fresh Install" atom.

  • Standard Uninstalled
  • Removed all Atom packages
  • Deleted ~/.atom/
  • Deleted ~/AppData/Local/Atom/
  • Deleted ~/AppData/Roaming/Atom/

Once I fresh installed Atom I even tried disabling certain Atom functions know to cause some delay from the other issues on GitHub Atom/Atom.

  • Anything git related
  • The filetree/sidebar

Steps to Reproduce

  1. Open Atom
  2. Have a project folder open
  3. Experience input delay

OR

  1. Have a project folder open
  2. Refocus Atom
  3. Experience input delay

Expected behavior:
Atom should (and used to) focus the window immediately and text could be pasted or typed without delay (sub 100ms).

Actual behavior:
Atom hangs, with something in the background being ran/processed for 800ms or so, and the user is left to wait it out, and then can use the program as needed after the second or so delay.

Screenshots and GIF video

1

2

atom_issue

Suggestions / thoughts

I think the issue is related to something that is checked with files. When git packages are disabled the issue still exists. Hence this issue being different than the slow git refresh issue.

To fix this I would imagine digging to find the issue/cause and changing whatever task from being 1st priority enough to "hang" the app. To a much lower more back-grounded task, something that even if it must take 800ms, for it to not interfere with the user's experience, and input.

I am able and willing to help out with this issue as needed. Just @d4rkd0s me.

Linked / similar issues (not the same but should aid in discovery)

#9544 Atom is slow regaining focus on Windows 7 with git repo
#8851 Atom unresponsive when switching between windows on desktop
#7275 Frequent recurring freezing on Windows

Other users reporting the same issue

These users have reported issues without a .git project open

Versions

Windows: Windows 10 Pro (licensed 64 bit)
Version: 1607
Build: 14393.479
Specs: 16GB RAM i7 3770k GTX1070

Atom : 1.12.7
Electron: 1.3.13
Chrome : 52.0.2743.82
Node : 6.5.0

apm 1.12.9
npm 3.10.5
node 4.4.5

python 2.7.12
git 2.9.2.windows.1
visual studio 2015

@d4rkd0s

This comment has been minimized.

Show comment
Hide comment
@d4rkd0s

d4rkd0s Dec 15, 2016

Total huge discovery, the project folders on the left have an impact on what you are currently editing. I tried the same exact project without my .git folder, and Atom is responding fully!

The absolutely odd thing is I have disabled ANY/ALL plugins/packages that are related to git.

Now to figure out how to resolve #9544 Atom is slow regaining focus on Windows 7 with git repo

I was having the same issue without git repos but its because the file I had open wasn't in that project, so this begs the question does Atom process all the "projects" on focus?

d4rkd0s commented Dec 15, 2016

Total huge discovery, the project folders on the left have an impact on what you are currently editing. I tried the same exact project without my .git folder, and Atom is responding fully!

The absolutely odd thing is I have disabled ANY/ALL plugins/packages that are related to git.

Now to figure out how to resolve #9544 Atom is slow regaining focus on Windows 7 with git repo

I was having the same issue without git repos but its because the file I had open wasn't in that project, so this begs the question does Atom process all the "projects" on focus?

@50Wliu

This comment has been minimized.

Show comment
Hide comment
@50Wliu

50Wliu Dec 15, 2016

Member

Ah, so this does have something to do with Git after all? Atom core also has some Git integration built in - did you disable those as well? (see #9544 (comment))

Member

50Wliu commented Dec 15, 2016

Ah, so this does have something to do with Git after all? Atom core also has some Git integration built in - did you disable those as well? (see #9544 (comment))

@d4rkd0s

This comment has been minimized.

Show comment
Hide comment
@d4rkd0s

d4rkd0s Dec 15, 2016

@50Wliu thank you 1000 fold. #9544 (comment) worked perfectly. Inserting the following:

disableGitRefreshOnFocus = ->
  atom.project.repositories.forEach (repo) ->
    if repo and repo.subscriptions and repo.subscriptions.disposables and repo.subscriptions.disposables.size
        Array.from(repo.subscriptions.disposables).forEach (item) ->
          content = item.disposalAction + ''
          if content.indexOf('focus') > 1
            item.dispose()
          return
  return

atom.project.emitter.on "did-change-paths", disableGitRefreshOnFocus
disableGitRefreshOnFocus()


atom.commands.add 'atom-text-editor', 'custom:refresh-git-status', ->
    atom.project.repositories.forEach (repo) ->
      repo.refreshStatus()

Into my coffee.init worked like a charm. @50Wliu think we can safely close this issue? I think #9544 is where the discussion of a true/permanent fix should be discussed.

d4rkd0s commented Dec 15, 2016

@50Wliu thank you 1000 fold. #9544 (comment) worked perfectly. Inserting the following:

disableGitRefreshOnFocus = ->
  atom.project.repositories.forEach (repo) ->
    if repo and repo.subscriptions and repo.subscriptions.disposables and repo.subscriptions.disposables.size
        Array.from(repo.subscriptions.disposables).forEach (item) ->
          content = item.disposalAction + ''
          if content.indexOf('focus') > 1
            item.dispose()
          return
  return

atom.project.emitter.on "did-change-paths", disableGitRefreshOnFocus
disableGitRefreshOnFocus()


atom.commands.add 'atom-text-editor', 'custom:refresh-git-status', ->
    atom.project.repositories.forEach (repo) ->
      repo.refreshStatus()

Into my coffee.init worked like a charm. @50Wliu think we can safely close this issue? I think #9544 is where the discussion of a true/permanent fix should be discussed.

@Willy156

This comment has been minimized.

Show comment
Hide comment
@Willy156

Willy156 Jan 26, 2017

noob here, when i regain focus on atom it takes me almost 2 seconds before I am able to type. has this been solved?

Willy156 commented Jan 26, 2017

noob here, when i regain focus on atom it takes me almost 2 seconds before I am able to type. has this been solved?

@d4rkd0s

This comment has been minimized.

Show comment
Hide comment
@d4rkd0s

d4rkd0s Jan 30, 2017

@willf Follow this issue here: #9544

That is where it's getting fixed/looked at.

d4rkd0s commented Jan 30, 2017

@willf Follow this issue here: #9544

That is where it's getting fixed/looked at.

@rayashi

This comment has been minimized.

Show comment
Hide comment
@rayashi

rayashi Feb 2, 2017

where is coffee.init?

rayashi commented Feb 2, 2017

where is coffee.init?

@allancarlos123

This comment has been minimized.

Show comment
Hide comment
@allancarlos123

allancarlos123 Mar 25, 2017

@rayashi Stay in File > Init Script
Solution: #9544 (comment)

allancarlos123 commented Mar 25, 2017

@rayashi Stay in File > Init Script
Solution: #9544 (comment)

@benhaworth81

This comment has been minimized.

Show comment
Hide comment
@benhaworth81

benhaworth81 Oct 3, 2017

@50Wliu , I had just started using git functionality this morning and couldn't work out what was happening. The suggested change to init.coffee worked for me. Thank you!

benhaworth81 commented Oct 3, 2017

@50Wliu , I had just started using git functionality this morning and couldn't work out what was happening. The suggested change to init.coffee worked for me. Thank you!

@lock

This comment has been minimized.

Show comment
Hide comment
@lock

lock bot Apr 1, 2018

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!

lock bot commented Apr 1, 2018

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!

@lock lock bot locked and limited conversation to collaborators Apr 1, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.