From a796d161725e8d879b941dada9a414c7f72eb8ee Mon Sep 17 00:00:00 2001 From: WangLin305 Date: Tue, 11 Mar 2025 15:09:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BA=9F=E5=BC=83=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3setWindowLayoutFullScreen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commons/base/src/main/ets/utils/WindowUtil.ets | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/commons/base/src/main/ets/utils/WindowUtil.ets b/commons/base/src/main/ets/utils/WindowUtil.ets index a050a95..3d06f43 100644 --- a/commons/base/src/main/ets/utils/WindowUtil.ets +++ b/commons/base/src/main/ets/utils/WindowUtil.ets @@ -64,12 +64,10 @@ export class WindowUtil { return; } // Set full-screen display. - this.mainWindowClass.setWindowLayoutFullScreen(true, (err) => { - if (err.code) { - Logger.error('Failed to set the window layout to full-screen mode. Cause:' + JSON.stringify(err)); - return; - } + this.mainWindowClass.setWindowLayoutFullScreen(true).then(() => { Logger.info('Succeeded in setting the window layout to full-screen mode.'); + }).catch((error: BusinessError) => { + Logger.error('Failed to set the window layout to full-screen mode. Cause:' + JSON.stringify(error)); }); } -- Gitee