* Open the screen selector window. * This shows a custom UI for selecting screens/windows. * Desktop only.
()
| 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 | |
| 1496 | export const tauriStreamCapture = new TauriStreamCapture(); |
no test coverage detected