     @subscribe $(window), 'focus', -> $("body").removeClass('is-blurred')
     @subscribe $(window), 'blur',  -> $("body").addClass('is-blurred')
     @subscribe $(window), 'window:open-path', (event, {pathToOpen, initialLine}) ->
-      rootView?.open(pathToOpen, {initialLine}) unless fsUtils.isDirectorySync(pathToOpen)
+      atom.rootView?.open(pathToOpen, {initialLine}) unless fsUtils.isDirectorySync(pathToOpen)
     @subscribe $(window), 'beforeunload', =>
-      confirmed = rootView?.confirmClose()
-      atom.hide() if confirmed and not @reloadRequested and remote.getCurrentWindow().isWebViewFocused()
+      confirmed = atom.rootView?.confirmClose()
+      atom.hide() if confirmed and not @reloadRequested and atom.getCurrentWindow().isWebViewFocused()
       @reloadRequested = false
       confirmed
     @subscribe $(window), 'unload', ->

$ = require './jquery-extensions'
_ = require './underscore-extensions'
ipc = require 'ipc'
remote = require 'remote'
Subscriber = require './subscriber'
fsUtils = require './fs-utils'


    @subscribeToCommand $(document), 'core:focus-next', @focusNext
    @subscribeToCommand $(document), 'core:focus-previous', @focusPrevious

    @subscribe $(document), 'keydown', atom.keymap.handleKeyEvent

    @subscribe $(document), 'drop', onDrop
    @subscribe $(document), 'dragover', (e) ->
