Use async ipc call to write to selection clipboard

This commit is contained in:
Kevin Sawicki
2014-11-19 11:04:07 -08:00
parent 46a7ea5936
commit fc87c98261
2 changed files with 7 additions and 0 deletions

View File

@@ -238,6 +238,11 @@ class AtomApplication
win = BrowserWindow.fromWebContents(event.sender)
win[method](args...)
clipboard = null
ipc.on 'write-text-to-selection-clipboard', (event, selectedText) ->
clipboard ?= require 'clipboard'
clipboard.writeText(selectedText)
# Public: Executes the given command.
#
# If it isn't handled globally, delegate to the currently focused window.