fix: address maintainer platform regressions
This commit is contained in:
@@ -453,6 +453,14 @@ function resolveUnpackedAppPath(...segments: string[]) {
|
||||
return resolved;
|
||||
}
|
||||
|
||||
function resolvePackagedResourcePath(...segments: string[]) {
|
||||
if (!app.isPackaged) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return path.join(process.resourcesPath, ...segments);
|
||||
}
|
||||
|
||||
function getNativeWindowsCaptureHelperCandidates() {
|
||||
const envPath = process.env.OPENSCREEN_WGC_CAPTURE_EXE?.trim();
|
||||
const archTag = process.arch === "arm64" ? "win32-arm64" : "win32-x64";
|
||||
@@ -468,6 +476,7 @@ function getNativeWindowsCaptureHelperCandidates() {
|
||||
),
|
||||
resolveUnpackedAppPath("electron", "native", "wgc-capture", "build", "wgc-capture.exe"),
|
||||
resolveUnpackedAppPath("electron", "native", "bin", archTag, "wgc-capture.exe"),
|
||||
resolvePackagedResourcePath("electron", "native", "bin", archTag, "wgc-capture.exe"),
|
||||
].filter((candidate): candidate is string => Boolean(candidate));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Rectangle } from "electron";
|
||||
import type { CursorRecordingData } from "../../../../src/native/contracts";
|
||||
import type { CursorRecordingSession } from "./session";
|
||||
import { TelemetryRecordingSession } from "./telemetryRecordingSession";
|
||||
import { WindowsNativeRecordingSession } from "./windowsNativeRecordingSession";
|
||||
|
||||
interface CreateCursorRecordingSessionOptions {
|
||||
@@ -12,6 +12,21 @@ interface CreateCursorRecordingSessionOptions {
|
||||
startTimeMs?: number;
|
||||
}
|
||||
|
||||
class NoopCursorRecordingSession implements CursorRecordingSession {
|
||||
async start(): Promise<void> {
|
||||
// Native cursor capture is currently Windows-only.
|
||||
}
|
||||
|
||||
async stop(): Promise<CursorRecordingData> {
|
||||
return {
|
||||
version: 2,
|
||||
provider: "none",
|
||||
assets: [],
|
||||
samples: [],
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export function createCursorRecordingSession(
|
||||
options: CreateCursorRecordingSessionOptions,
|
||||
): CursorRecordingSession {
|
||||
@@ -25,10 +40,5 @@ export function createCursorRecordingSession(
|
||||
});
|
||||
}
|
||||
|
||||
return new TelemetryRecordingSession({
|
||||
getDisplayBounds: options.getDisplayBounds,
|
||||
maxSamples: options.maxSamples,
|
||||
sampleIntervalMs: options.sampleIntervalMs,
|
||||
startTimeMs: options.startTimeMs,
|
||||
});
|
||||
return new NoopCursorRecordingSession();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user