# Receiving sources result from main process, now send them back to renderer.
handledRequest = requestsQueue.shift 0
result = ({ id: source.id, name: source.name, thumbnail: source.thumbnail.toDataUrl() } for source in sources)
- handledRequest.webContents?.send 'ATOM_REDNERER_DESKTOP_CAPTURER_RESULT', result
+ handledRequest.webContents?.send 'ATOM_RENDERER_DESKTOP_CAPTURER_RESULT', result
# Check the queue to see whether there is other same request. If has, handle
# it for reducing redunplicated `desktopCaptuer.startHandling` calls.
unhandledRequestsQueue = []
for request in requestsQueue
if isOptionsEqual handledRequest.options, request.options
- request.webContents?.send 'ATOM_REDNERER_DESKTOP_CAPTURER_RESULT', result
+ request.webContents?.send 'ATOM_RENDERER_DESKTOP_CAPTURER_RESULT', result
else
unhandledRequestsQueue.push request
requestsQueue = unhandledRequestsQueue
getSources = (options, callback) ->
ipc.send 'ATOM_BROWSER_DESKTOP_CAPTURER_GET_SOURCES', options
- ipc.once 'ATOM_REDNERER_DESKTOP_CAPTURER_RESULT', (sources) ->
+ ipc.once 'ATOM_RENDERER_DESKTOP_CAPTURER_RESULT', (sources) ->
callback ({id: source.id, name: source.name, thumbnail: NativeImage.createFromDataUrl source.thumbnail} for source in sources)
module.exports =
* `types` Array - An array of String that enums the types of desktop sources.
* `screen` String - Screen
* `window` String - Individual window
-* `thumnailSize` Object (optional) - The suggested size that thumbnail should be
- scaled.
+* `thumbnailSize` Object (optional) - The suggested size that thumbnail should
+ be scaled.
* `width` Integer - The width of thumbnail. By default, it is 150px.
* `height` Integer - The height of thumbnail. By default, it is 150px.
Gets all desktop sources.
**Note:** There is no garuantee that the size of `source.thumbnail` is always
-the same as the `thumnailSize` in `options`. It also depends on the scale of the
-screen or window.
+the same as the `thumnbailSize` in `options`. It also depends on the scale of
+the screen or window.
## Source