diff --git a/src/window-event-handler.coffee b/src/window-event-handler.coffee index 7c786297d..4f52f7115 100644 --- a/src/window-event-handler.coffee +++ b/src/window-event-handler.coffee @@ -19,14 +19,7 @@ class WindowEventHandler @addEventListener(window, 'blur', @handleWindowBlur) @addEventListener(window, 'beforeunload', @handleWindowBeforeunload) @addEventListener(window, 'unload', @handleWindowUnload) - @addEventListener(window, 'window:toggle-full-screen', @handleWindowToggleFullScreen) - @addEventListener(window, 'window:close', @handleWindowClose) - @addEventListener(window, 'window:reload', @handleWindowReload) - @addEventListener(window, 'window:toggle-dev-tools', @handleWindowToggleDevTools) - @addEventListener(window, 'window:toggle-menu-bar', @handleWindowToggleMenuBar) if process.platform in ['win32', 'linux'] - @addEventListener(document, 'core:focus-next', @handleFocusNext) - @addEventListener(document, 'core:focus-previous', @handleFocusPrevious) @addEventListener(document, 'keydown', @handleDocumentKeydown) @addEventListener(document, 'drop', @handleDocumentDrop) @addEventListener(document, 'dragover', @handleDocumentDragover) @@ -34,6 +27,20 @@ class WindowEventHandler @addEventListener(document, 'submit', @handleDocumentSubmit) @addEventListener(document, 'contextmenu', @handleDocumentContextmenu) + @subscriptions.add atom.commands.add window, + 'window:toggle-full-screen': @handleWindowToggleFullScreen + 'window:close': @handleWindowClose + 'window:reload': @handleWindowReload + 'window:toggle-dev-tools': @handleWindowToggleDevTools + + if process.platform in ['win32', 'linux'] + @subscriptions.add atom.commands.add window, + 'window:toggle-menu-bar': @handleWindowToggleMenuBar + + @subscriptions.add atom.commands.add document, + 'core:focus-next': @handleFocusNext + 'core:focus-previous': @handleFocusPrevious + @handleNativeKeybindings() # Wire commands that should be handled by Chromium for elements with the