diff --git a/create-window.js b/create-window.js
index <HASH>..<HASH> 100644
--- a/create-window.js
+++ b/create-window.js
@@ -4,6 +4,7 @@ const BrowserWindow = require('electron').BrowserWindow
 const ipc = require('electron').ipcMain
 const chokidar = require('chokidar')
 const assign = require('object-assign')
+const sharedState = require('./shared-state')
 const styles = require('./styles')
 
 const defaultOptions = {
@@ -37,6 +38,14 @@ module.exports = function createWindow (options) {
     win = null
   })
 
+  win.on('focus', function () {
+    sharedState.setFocusedWindow(win.id)
+  })
+
+  if (win.isFocused()) {
+    sharedState.setFocusedWindow(win.id)
+  }
+
   if (options.devTools) {
     win.openDevTools()
   }
set focused window ID in shared state when focus changes