diff options
-rw-r--r-- | src/index.ts | 6 | ||||
-rw-r--r-- | src/webview/screenshare.ts | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/index.ts b/src/index.ts index ef9d5bd72..59a90a3cb 100644 --- a/src/index.ts +++ b/src/index.ts | |||
@@ -7,6 +7,7 @@ import { | |||
7 | ipcMain, | 7 | ipcMain, |
8 | session, | 8 | session, |
9 | dialog, | 9 | dialog, |
10 | desktopCapturer, | ||
10 | } from 'electron'; | 11 | } from 'electron'; |
11 | 12 | ||
12 | import { emptyDirSync, ensureFileSync } from 'fs-extra'; | 13 | import { emptyDirSync, ensureFileSync } from 'fs-extra'; |
@@ -632,6 +633,11 @@ ipcMain.on('set-spellchecker-locales', (_e, { locale, serviceId }) => { | |||
632 | serviceSession.setSpellCheckerLanguages(locales); | 633 | serviceSession.setSpellCheckerLanguages(locales); |
633 | }); | 634 | }); |
634 | 635 | ||
636 | |||
637 | ipcMain.handle('get-desktop-capturer-sources', () => desktopCapturer.getSources({ | ||
638 | types: ['screen', 'window'], | ||
639 | })); | ||
640 | |||
635 | ipcMain.on('window.toolbar-double-clicked', () => { | 641 | ipcMain.on('window.toolbar-double-clicked', () => { |
636 | mainWindow?.isMaximized() ? mainWindow.unmaximize() : mainWindow?.maximize(); | 642 | mainWindow?.isMaximized() ? mainWindow.unmaximize() : mainWindow?.maximize(); |
637 | }); | 643 | }); |
diff --git a/src/webview/screenshare.ts b/src/webview/screenshare.ts index dbc23d62c..e631ce52f 100644 --- a/src/webview/screenshare.ts +++ b/src/webview/screenshare.ts | |||
@@ -1,11 +1,9 @@ | |||
1 | import { desktopCapturer } from 'electron'; | 1 | import { ipcRenderer } from 'electron'; |
2 | 2 | ||
3 | const CANCEL_ID = 'desktop-capturer-selection__cancel'; | 3 | const CANCEL_ID = 'desktop-capturer-selection__cancel'; |
4 | 4 | ||
5 | export async function getDisplayMediaSelector() { | 5 | export async function getDisplayMediaSelector() { |
6 | const sources = await desktopCapturer.getSources({ | 6 | const sources = await ipcRenderer.invoke('get-desktop-capturer-sources'); |
7 | types: ['screen', 'window'], | ||
8 | }); | ||
9 | return `<div class="desktop-capturer-selection__scroller"> | 7 | return `<div class="desktop-capturer-selection__scroller"> |
10 | <ul class="desktop-capturer-selection__list"> | 8 | <ul class="desktop-capturer-selection__list"> |
11 | ${sources | 9 | ${sources |