mirror of
https://github.com/atom/atom.git
synced 2026-01-22 21:38:10 -05:00
Apply workaround for clearing of focus upon loading of window
After the first window focus event, the focus is getting cleared back to document.body regardless of the prior active element. Refocusing workspace on a delay after the first window focus event works around the problem.
This commit is contained in:
@@ -9,3 +9,9 @@ atom.initialize()
|
||||
atom.startEditorWindow()
|
||||
window.atom.loadTime = Date.now() - startTime
|
||||
console.log "Window load time: #{atom.getWindowLoadTime()}ms"
|
||||
|
||||
# Workaround for focus getting cleared upon window creation
|
||||
windowFocused = (e) ->
|
||||
window.removeEventListener('focus', windowFocused)
|
||||
setTimeout (-> document.querySelector('.workspace').focus()), 0
|
||||
window.addEventListener('focus', windowFocused)
|
||||
|
||||
Reference in New Issue
Block a user