       listener      : @
       callback      : =>
         delete @windowResizeListeners[instance.id]
-  
+
   setWindowProperties:(event)->
     @winWidth  = $(window).width()
     @winHeight = $(window).height()
-  
+
   notifyWindowResizeListeners:(event, throttle = no, duration = 17)->
     event or= type : "resize"
     if throttle

      @keyView = newKeyView
      newKeyView?.propagateEvent KDEventType : 'KDViewBecameKeyView'
      @propagateEvent (KDEventType: 'WindowChangeKeyView', globalEvent : yes), view: newKeyView
  
  setDragView:(dragView)->
    
    @setDragInAction yes
    @dragView = dragView
  
  unsetDragView:(e)->
    
    @setDragInAction no
    @dragView.emit "DragFinished", e, @dragState
    @dragView = null
    
    
  redirectMouseMoveEvent:(event)->

    view = @dragView
    return unless @dragView
    
    {pageX, pageY}   = event
    {startX, startY} = view.dragState

    delta =
      x : pageX - startX
      y : pageY - startY
    
    view.drag event, delta
  
  getKeyView:()->
    @keyView


      @propagateEvent (KDEventType: 'DropOnWindow'), event
      @setDragInAction no
    , yes

    @layers = layers = []

    document.body.addEventListener 'mousedown', (e)=>
