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