diff --git a/pal/minigame/runtime.ts b/pal/minigame/runtime.ts index 3cf0f8b4f4..5f298a3563 100644 --- a/pal/minigame/runtime.ts +++ b/pal/minigame/runtime.ts @@ -1,4 +1,6 @@ -import { IMiniGame } from 'pal/minigame'; +import { VIVO } from 'internal:constants'; +import { SystemInfo, IMiniGame } from 'pal/minigame'; + import { Orientation } from '../system/enum-type/orientation'; import { cloneObject, createInnerAudioContextPolyfill } from '../utils'; @@ -86,4 +88,14 @@ minigame.getSafeArea = function () { return { top, left, bottom, right, width, height }; }; +if (VIVO) { + // HACK: need to be handled in ral lib. + minigame.getSystemInfoSync = function () { + const sys = ral.getSystemInfoSync() as SystemInfo; + sys.windowWidth = sys.screenWidth; + sys.windowHeight = sys.screenHeight; + return sys; + }; +} + export { minigame };