     window.onfocus = @bound 'focusChange'
     window.onblur  = @bound 'focusChange'
 
+
   addUnloadListener:(key, listener)->
     @unloadListeners[key] or= []
     @unloadListeners[key].push listener
 
+
   clearUnloadListeners: (key)->
 
     if key


    if view is @keyView and @keyView isnt @oldKeyView
      @setKeyView @oldKeyView

  superizeCombos = (combos)->


      layer.on 'KDObjectWillBeDestroyed', =>
        @removeLayer layer


  removeLayer: (layer)->

    if layer in @layers
      # log "layer removed", layer
      index = @layers.indexOf(layer)
      @layers.splice index, 1


  bindEvents:->

