Skip to content

Create polished demo videos without editing skills. Mac/Windows/Linux

fix(windows): address PR 517 review feedback

webadderall4c260584def4
diff --git a/electron/ipc/monitorResolver.ts b/electron/ipc/monitorResolver.ts
index daaf576e..e71f36c1 100644
--- a/electron/ipc/monitorResolver.ts
+++ b/electron/ipc/monitorResolver.ts
@@ -55,6 +55,7 @@ public class MonitorHelper {
const result = spawnSync("powershell.exe", ["-NoProfile", "-NonInteractive", "-Command", psScript], {
encoding: "utf-8",
+ timeout: 5000,
});
if (result.error || result.status !== 0) {
diff --git a/electron/ipc/register/recording.ts b/electron/ipc/register/recording.ts
index bd8c8927..699779d3 100644
--- a/electron/ipc/register/recording.ts
+++ b/electron/ipc/register/recording.ts
@@ -75,7 +75,6 @@ import {
waitForWindowsCaptureStart,
waitForWindowsCaptureStop,
} from "../recording/windows";
-import { getMonitorHandles } from "../monitorResolver";
import {
shouldStartWindowsBrowserMicrophoneFallback,
shouldUseWindowsBrowserMicrophoneFallback,
@@ -439,10 +438,11 @@ export function registerRecordingHandlers(
// Windows Graphics Capture (WGC) requires a raw HMONITOR handle.
// We attempt to resolve the handle by matching the physical coordinates of the target display.
const monitors = getMonitorHandles();
- const matchedMonitor = monitors.find(m =>
- m.x === Math.round(displayBounds.x) &&
- m.y === Math.round(displayBounds.y)
- ) || monitors[0];
+ const matchedMonitor = monitors.find(
+ (monitor) =>
+ monitor.x === Math.round(displayBounds.x) &&
+ monitor.y === Math.round(displayBounds.y),
+ );
if (matchedMonitor) {
config.displayId = matchedMonitor.handle;
@@ -466,6 +466,8 @@ export function registerRecordingHandlers(
config.captureSystemAudio = true;
config.audioOutputPath = tempAudioPath;
setWindowsSystemAudioPath(systemAudioPath);
+ } else {
+ setWindowsSystemAudioPath(null);
}
if (options?.capturesMicrophone && !browserMicFallbackRequested) {
@@ -480,6 +482,8 @@ export function registerRecordingHandlers(
} else if (browserMicFallbackRequested) {
config.captureMic = false;
setWindowsMicAudioPath(null);
+ } else {
+ setWindowsMicAudioPath(null);
}
recordNativeCaptureDiagnostics({
@@ -574,6 +578,9 @@ export function registerRecordingHandlers(
setNativeScreenRecordingActive(false);
setWindowsCaptureProcess(null);
setWindowsCaptureTargetPath(null);
+ setWindowsSystemAudioPath(null);
+ setWindowsMicAudioPath(null);
+ setWindowsOrphanedMicAudioPath(null);
setWindowsCaptureStopRequested(false);
setWindowsCapturePaused(false);
return {