Merge branch 'master' of gitee.com:openharmony/window_window_manager into jilinghao4

Change-Id: I1043aef49d2719d8090e5eb68773bf1496611741
This commit is contained in:
linghao-ji 2023-01-17 09:57:20 +08:00
commit 73d203db1c
4 changed files with 17 additions and 5 deletions

View File

@ -245,7 +245,7 @@ bool SnapShotUtils::WriteRgb888ToJpeg(FILE* file, uint32_t width, uint32_t heigh
jpeg.in_color_space = JCS_RGB;
jpeg_set_defaults(&jpeg);
constexpr int32_t quality = 100;
constexpr int32_t quality = 75;
jpeg_set_quality(&jpeg, quality, TRUE);
jpeg_stdio_dest(&jpeg, file);

View File

@ -485,6 +485,7 @@ HWTEST_F(ScreenManagerTest, ScreenManager08, Function | MediumTest | Level2)
HWTEST_F(ScreenManagerTest, ScreenManager09, Function | MediumTest | Level2)
{
(void)system("param set rosen.uni.partialrender.enabled 0");
DisplayTestUtils utils;
ASSERT_TRUE(utils.CreateSurface());
defaultOption_.surface_ = utils.psurface_;
@ -523,6 +524,7 @@ HWTEST_F(ScreenManagerTest, ScreenManager09, Function | MediumTest | Level2)
window->Show();
sleep(TEST_SLEEP_S_LONG);
window->Destroy();
(void)system("param set rosen.uni.partialrender.enabled 4");
}
@ -877,15 +879,18 @@ HWTEST_F(ScreenManagerTest, VirtualExpandScreen01, Function | MediumTest | Level
ASSERT_TRUE(utils.CreateSurface());
defaultOption_.surface_ = utils.psurface_;
defaultOption_.isForShot_ = true;
CHECK_TEST_INIT_SCREEN_STATE
ScreenId virtualScreenId = ScreenManager::GetInstance().CreateVirtualScreen(defaultOption_);
sleep(TEST_SLEEP_S);
CHECK_SCREEN_STATE_AFTER_CREATE_VIRTUAL_SCREEN
CheckScreenStateInGroup(false, group, groupId, virtualScreen, virtualScreenId);
sleep(TEST_SLEEP_S);
std::vector<ExpandOption> options = {{defaultScreenId_, 0, 0}, {virtualScreenId, defaultWidth_, 0}};
ScreenId expansionId = ScreenManager::GetInstance().MakeExpand(options);
sleep(TEST_SLEEP_S);
CheckScreenGroupState(ScreenCombination::SCREEN_EXPAND, ScreenGroupChangeEvent::ADD_TO_GROUP,
virtualScreenId, group, screenGroupChangeListener);
CheckScreenStateInGroup(true, group, groupId, virtualScreen, virtualScreenId);
@ -908,6 +913,7 @@ HWTEST_F(ScreenManagerTest, VirtualExpandScreen01, Function | MediumTest | Level
ASSERT_TRUE(screen);
auto display = DisplayManager::GetInstance().GetDisplayByScreen(virtualScreenId);
ASSERT_TRUE(display);
uint32_t orientation = static_cast<uint32_t>(Orientation::VERTICAL);
uint32_t end = static_cast<uint32_t>(Orientation::REVERSE_HORIZONTAL);
ASSERT_TRUE(screenListener);
@ -928,8 +934,8 @@ HWTEST_F(ScreenManagerTest, VirtualExpandScreen01, Function | MediumTest | Level
window->Destroy();
DMError res = ScreenManager::GetInstance().DestroyVirtualScreen(virtualScreenId);
sleep(TEST_SLEEP_S);
ASSERT_EQ(DMError::DM_OK, res);
ScreenManager::GetInstance().UnregisterScreenListener(screenListener);
ScreenManager::GetInstance().UnregisterScreenGroupListener(screenGroupChangeListener);
ScreenManager::GetInstance().UnregisterVirtualScreenGroupListener(virtualScreenGroupChangeListener);

View File

@ -682,7 +682,7 @@ WMError WindowManagerService::CreateWindow(sptr<IWindow>& window, sptr<WindowPro
WLOGFE("window is invalid");
return WMError::WM_ERROR_NULLPTR;
}
if(!CheckSystemWindowPermission(property)) {
if (!CheckSystemWindowPermission(property)) {
WLOGFE("create system window permission denied!");
return WMError::WM_ERROR_INVALID_PERMISSION;
}

View File

@ -185,6 +185,10 @@ void WindowNodeContainer::LayoutWhenAddWindowNode(sptr<WindowNode>& node, bool a
{
if (afterAnimation) {
layoutPolicy_->PerformWindowLayout(node, WindowUpdateType::WINDOW_UPDATE_ADDED);
// tile layout will change window mode from fullscreen to float
// notify systembar window to change color
NotifyIfAvoidAreaChanged(node, AvoidControlType::AVOID_NODE_ADD);
DumpScreenWindowTreeByWinId(node->GetWindowId());
return;
}
WLOGI("AddWindowNode Id:%{public}u, currState:%{public}u",
@ -206,6 +210,10 @@ void WindowNodeContainer::LayoutWhenAddWindowNode(sptr<WindowNode>& node, bool a
node->SetWindowSizeChangeReason(WindowSizeChangeReason::CUSTOM_ANIMATION_SHOW);
}
layoutPolicy_->PerformWindowLayout(node, WindowUpdateType::WINDOW_UPDATE_ADDED);
// tile layout will change window mode from fullscreen to float
// notify systembar window to change color
NotifyIfAvoidAreaChanged(node, AvoidControlType::AVOID_NODE_ADD);
DumpScreenWindowTreeByWinId(node->GetWindowId());
}
}
@ -242,8 +250,6 @@ WMError WindowNodeContainer::AddWindowNode(sptr<WindowNode>& node, sptr<WindowNo
}
AssignZOrder();
LayoutWhenAddWindowNode(node, afterAnimation);
NotifyIfAvoidAreaChanged(node, AvoidControlType::AVOID_NODE_ADD);
DumpScreenWindowTreeByWinId(node->GetWindowId());
UpdateCameraFloatWindowStatus(node, true);
if (WindowHelper::IsAppWindow(node->GetWindowType())) {
backupWindowIds_.clear();