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:
Nathan Sobo
2014-11-11 13:09:27 -07:00
parent 9fd52f600e
commit e238292075

View File

@@ -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()