Skip to content

Commit

Permalink
fixup! fix(talk): show only thumbnail preview on Wayland
Browse files Browse the repository at this point in the history
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
  • Loading branch information
ShGKme committed Apr 5, 2024
1 parent 804a3b1 commit 898b5b2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/talk/renderer/components/DesktopMediaSourceDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { computed, nextTick, onBeforeUnmount, onMounted, ref } from 'vue'

import MdiCancel from '@mdi/svg/svg/cancel.svg?raw'
import MdiMonitorShare from '@mdi/svg/svg/monitor-share.svg?raw'
import MdiApplicationOutline from 'vue-material-design-icons/ApplicationOutline.vue'
import MdiMonitor from 'vue-material-design-icons/Monitor.vue'
import MdiMonitorSpeaker from 'vue-material-design-icons/MonitorSpeaker.vue'

Expand Down Expand Up @@ -115,6 +116,15 @@ const requestDesktopCapturerSources = async () => {
})
}

// On Wayland there might be no name from the desktopCapturer
if (window.OS.isWayland) {
for (const source of sources.value) {
source.name ||= source.id.startsWith('screen:')
? t('talk_desktop', 'Selected screen')
: t('talk_desktop', 'Selected window')
}
}

// Preselect the first media source if any
selectedSourceId.value = sources.value[0]?.id
}
Expand Down Expand Up @@ -181,6 +191,7 @@ onBeforeUnmount(() => {
class="capture-source__caption-icon">
<MdiMonitorSpeaker v-else-if="source.id.startsWith('entire-desktop:')" :size="16" />
<MdiMonitor v-else-if="source.id.startsWith('screen:')" :size="16" />
<MdiApplicationOutline v-else-if="source.id.startsWith('window:')" :size="16" />
<span class="capture-source__caption-text">{{ source.name }}</span>
</span>
</label>
Expand Down

0 comments on commit 898b5b2

Please sign in to comment.