         @pane.focus()
         false
 
+    RendererIpc.on('tab:dropped', @onDropOnOtherWindow)
+
     @pane.prepend(this)
+
+  beforeRemove: ->
+    RendererIpc.removeListener('tab:dropped', @onDropOnOtherWindow)
 
   addTabForItem: (item, index) ->
     @insertTabAtIndex(new TabView(item, @pane), index)

    pane = $(event.target).closest('.pane')
    paneIndex = @paneContainer.indexOfPane(pane)
    event.originalEvent.dataTransfer.setData 'from-pane-index', paneIndex

    item = @pane.getItems()[el.index()]
    if item.getPath?

    return if index is -1
    @closeTab tab for tab, i in tabs when i > index

  getProcessId: ->
    @processId ?= atom.getCurrentWindow().getProcessId()

  getRoutingId: ->
    @routingId ?= atom.getCurrentWindow().getRoutingId()

  onDragStart: (event) =>
    event.originalEvent.dataTransfer.setData 'atom-event', 'true'

    el = $(event.target).closest('.sortable')
    el.addClass 'is-dragging'
