     
     @listenWindowResize()
     
-    $(window).bind "focus", =>
-      @terminal.setFocused true
+    @on "ReceivedClickElsewhere", =>
+      @terminal.setFocused false
+      @getSingleton('windowController').removeLayer @
+
+    # $(window).bind "focus", =>
+    #   @terminal.setFocused true
     
-    $(window).bind "blur", =>
-      @terminal.setFocused false
+    # $(window).bind "blur", =>
+    #   @terminal.setFocused false
     
     KD.whoami().tellKite
       kiteName: 'webterm',

        @terminal.showSessions()
    , 3000
  
  click: ->
    @setKeyView()
    

            name: sessions[key]
            mainView: this
        @sessionBox.show()

      KD.whoami().tellKite
        kiteName: 'webterm',
        method: 'createServer',
