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

Method showSelector

app/src/utils/tauriStreamCapture.ts:1451–1471  ·  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

1449 * Desktop only.
1450 */
1451 async showSelector(): Promise<void> {
1452 if (!isTauri() || !isDesktop()) {
1453 throw new Error('Screen selector only available on desktop');
1454 }
1455
1456 // Import dynamically to avoid bundling desktop-only code
1457 const { WebviewWindow } = await import('@tauri-apps/api/webviewWindow');
1458
1459 // Get or create the selector window
1460 let selectorWindow = await WebviewWindow.getByLabel('screen-selector');
1461
1462 if (!selectorWindow) {
1463 // Window doesn't exist, might have been closed - create it
1464 Logger.warn("TAURI_STREAM", "Screen selector window not found, it may need to be recreated");
1465 throw new Error('Screen selector window not available');
1466 }
1467
1468 // Show and focus the window
1469 await selectorWindow.show();
1470 await selectorWindow.setFocus();
1471 }
1472}
1473
1474export const tauriStreamCapture = new TauriStreamCapture();

Callers 1

startCaptureMethod · 0.95

Calls 3

isTauriFunction · 0.90
isDesktopFunction · 0.90
warnMethod · 0.80

Tested by

no test coverage detected