From f0b6a8e079379c793e2a6dd057da39f6fe66ee57 Mon Sep 17 00:00:00 2001 From: xdongs Date: Fri, 16 May 2025 10:19:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=90=E7=AA=97=E8=B7=9F=E9=9A=8F=E7=88=B6?= =?UTF-8?q?=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xdongs --- .../enable_notification_dialog/AppScope/app.json | 4 ++-- .../ServiceExtAbility/NotificationServiceExtAbility.ts | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/services/dialog_ui/enable_notification_dialog/AppScope/app.json b/services/dialog_ui/enable_notification_dialog/AppScope/app.json index 796fd930b..d7b285812 100644 --- a/services/dialog_ui/enable_notification_dialog/AppScope/app.json +++ b/services/dialog_ui/enable_notification_dialog/AppScope/app.json @@ -2,8 +2,8 @@ "app": { "bundleName": "com.ohos.notificationdialog", "vendor": "example", - "versionCode": 1000024, - "versionName": "1.2.4", + "versionCode": 1000025, + "versionName": "1.2.5", "icon": "$media:app_icon", "label": "$string:app_name", "distributedNotificationEnabled": true, diff --git a/services/dialog_ui/enable_notification_dialog/entry/src/main/ets/ServiceExtAbility/NotificationServiceExtAbility.ts b/services/dialog_ui/enable_notification_dialog/entry/src/main/ets/ServiceExtAbility/NotificationServiceExtAbility.ts index 50b63ba20..dfe0f3845 100644 --- a/services/dialog_ui/enable_notification_dialog/entry/src/main/ets/ServiceExtAbility/NotificationServiceExtAbility.ts +++ b/services/dialog_ui/enable_notification_dialog/entry/src/main/ets/ServiceExtAbility/NotificationServiceExtAbility.ts @@ -178,7 +178,9 @@ export class EnableNotificationDialog { let waiteTimes = 0; extensionWindow.on('rectChange', uiExtension.RectChangeReason.HOST_WINDOW_RECT_CHANGE, (data):void => { console.info(TAG, `windowRectChange ts event ${data.rect?.left},${data.rect?.top}, ${data.rect?.width}, ${data.rect?.height}`); - hasDisalogRectInfo = true; + if(data.rect?.width > 0 && data.rect?.height > 0) { + hasDisalogRectInfo = true; + } }); while(!hasDisalogRectInfo && waiteTimes < 10){ waiteTimes ++; @@ -204,6 +206,11 @@ export class EnableNotificationDialog { this.initSubWindowSize = true; } } + try { + await subWindow.setFollowParentWindowLayoutEnabled(true); + } catch (err) { + console.error(TAG, `setFollowParentWindowLayoutEnabled failed! ${err.code} ${err.message}`); + } await subWindow.loadContent(path, this.storage); try { await subWindow.hideNonSystemFloatingWindows(true); -- Gitee