Merge pull request #10032 from SivanCola/fix/desktop-stub-zoom-routing

fix(desktop): route stub native zoom through the command table / 桌面测试桩的原生缩放改走命令表
This commit is contained in:
SivanCola authored and GitHub committed 2026-09-09 21:37:15 +08:00
commit 9494b32f9f
1 file changed
+12 -2
@@ -79,8 +79,18 @@ export function installDesktopHostStub(commands: object, options: DesktopHostStu
minimise: () => {},
toggleMaximise: () => {},
close: () => {},
getAppZoom: async () => 1,
setAppZoom: async () => 1,
// The Electron shell owns zoom natively; tests drive it through the
// same command table the bridge path uses, so tables without zoom
// commands keep the neutral default.
getAppZoom: async () => {
const fn = ref.current.GetDesktopZoomFactor as (() => Promise<number>) | undefined;
return typeof fn === "function" ? await fn() : 1;
},
setAppZoom: async (factor: number) => {
const fn = ref.current.SetDesktopZoomFactor as ((factor: number) => Promise<number>) | undefined;
if (typeof fn === "function") await fn(factor);
return factor;
},
resetAppZoom: async () => 1,
},
getPathForFile: options.getPathForFile ?? (() => ""),