diff --git a/src/browser/application.coffee b/src/browser/application.coffee index 55c12d53a..885da706b 100644 --- a/src/browser/application.coffee +++ b/src/browser/application.coffee @@ -328,7 +328,7 @@ class Application else if focusedBrowserWindow? # Note: We sometimes display non-"AtomWindow" windows, for things like # raw message contents. Ensure that these also get to run window commands - unless global.application.sendCommandToFirstResponder(command) + unless @sendCommandToFirstResponder(command) switch command when 'window:reload' then focusedBrowserWindow.reload() when 'window:toggle-dev-tools' then focusedBrowserWindow.toggleDevTools() diff --git a/src/window-event-handler.coffee b/src/window-event-handler.coffee index f06eb4c78..5fa29677d 100644 --- a/src/window-event-handler.coffee +++ b/src/window-event-handler.coffee @@ -101,23 +101,22 @@ class WindowEventHandler @handleNativeKeybindings() - # Wire commands that should be handled by the native menu - # for elements with the `.override-key-bindings` class. + # Wire commands that should be handled by Chromium for elements with the + # `.override-key-bindings` class. handleNativeKeybindings: -> menu = null bindCommandToAction = (command, action) => @subscribe $(document), command, (event) -> unless event.target.webkitMatchesSelector('.override-key-bindings') - menu ?= require('remote').require('menu') - menu.sendActionToFirstResponder(action) + atom.getCurrentWindow().webContents[action]() true - bindCommandToAction('core:copy', 'copy:') - bindCommandToAction('core:cut', 'cut:') - bindCommandToAction('core:paste', 'paste:') - bindCommandToAction('core:undo', 'undo:') - bindCommandToAction('core:redo', 'redo:') - bindCommandToAction('core:select-all', 'selectAll:') + bindCommandToAction('core:copy', 'copy') + bindCommandToAction('core:cut', 'cut') + bindCommandToAction('core:paste', 'paste') + bindCommandToAction('core:undo', 'undo') + bindCommandToAction('core:redo', 'redo') + bindCommandToAction('core:select-all', 'selectAll') onKeydown: (event) -> atom.keymaps.handleKeyboardEvent(event)