mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Remove WorkspaceElement::handleWindowFocus
We were getting stack traces in specs when the window got focused caused by this subscription never getting disposed. We investigated, and can’t find a case where removing this causes any issues. Tested: * Loading/reloading empty window * Loading/reloading window with pane splits * Opening/closing dev tools * Switching focus between atom windows * Switching focus between applications Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
This commit is contained in:
@@ -67,11 +67,7 @@ class WorkspaceElement extends HTMLElement
|
||||
setModel: (@model) ->
|
||||
@paneContainer = atom.views.getView(@model.paneContainer)
|
||||
@verticalAxis.appendChild(@paneContainer)
|
||||
|
||||
@addEventListener 'focus', @handleFocus.bind(this)
|
||||
handleWindowFocus = @handleWindowFocus.bind(this)
|
||||
window.addEventListener 'focus', handleWindowFocus
|
||||
@subscriptions.add(new Disposable -> window.removeEventListener 'focus', handleWindowFocus)
|
||||
|
||||
@panelContainers =
|
||||
top: @model.panelContainers.top.getView()
|
||||
@@ -107,9 +103,6 @@ class WorkspaceElement extends HTMLElement
|
||||
handleFocus: (event) ->
|
||||
@model.getActivePane().activate()
|
||||
|
||||
handleWindowFocus: (event) ->
|
||||
@handleFocus(event) if document.activeElement is document.body
|
||||
|
||||
focusPaneViewAbove: -> @paneContainer.focusPaneViewAbove()
|
||||
|
||||
focusPaneViewBelow: -> @paneContainer.focusPaneViewBelow()
|
||||
|
||||
Reference in New Issue
Block a user