MCPcopy Create free account
hub / github.com/Roy3838/Observer / showSelector

Method showSelector

app/src/utils/tauriStreamCapture.ts:1473–1493  ·  view source on GitHub ↗

* Open the screen selector window. * This shows a custom UI for selecting screens/windows. * Desktop only.

()

Source from the content-addressed store, hash-verified

1471 * Desktop only.
1472 */
1473 async showSelector(): Promise<void> {
1474 if (!isTauri() || !isDesktop()) {
1475 throw new Error('Screen selector only available on desktop');
1476 }
1477
1478 // Import dynamically to avoid bundling desktop-only code
1479 const { WebviewWindow } = await import('@tauri-apps/api/webviewWindow');
1480
1481 // Get or create the selector window
1482 let selectorWindow = await WebviewWindow.getByLabel('screen-selector');
1483
1484 if (!selectorWindow) {
1485 // Window doesn't exist, might have been closed - create it
1486 Logger.warn("TAURI_STREAM", "Screen selector window not found, it may need to be recreated");
1487 throw new Error('Screen selector window not available');
1488 }
1489
1490 // Show and focus the window
1491 await selectorWindow.show();
1492 await selectorWindow.setFocus();
1493 }
1494}
1495
1496export const tauriStreamCapture = new TauriStreamCapture();

Callers 1

startCaptureMethod · 0.95

Calls 4

isTauriFunction · 0.90
isDesktopFunction · 0.90
warnMethod · 0.80
showMethod · 0.80

Tested by

no test coverage detected