mirror of
https://gitee.com/openharmony/window_window_manager
synced 2024-11-23 06:50:40 +00:00
commit
88530a7c98
@ -210,11 +210,8 @@ void SuperFoldStateManager::HandleDisplayNotify(SuperFoldStatusChangeEvents chan
|
||||
|
||||
void SuperFoldStateManager::HandleExtendToHalfFoldDisplayNotify(sptr<ScreenSession> screenSession)
|
||||
{
|
||||
ScreenProperty screenProperty = screenSession->GetScreenProperty();
|
||||
uint32_t screenWidth = screenProperty.GetFakeBounds().rect_.GetWidth();
|
||||
uint32_t screenHeight = screenProperty.GetFakeBounds().rect_.GetHeight();
|
||||
screenSession->UpdatePropertyByResolution(screenWidth, screenHeight);
|
||||
screenSession->UpdatePropertyByFakeInUse(true);
|
||||
screenSession->SetIsBScreenHalf(true);
|
||||
ScreenSessionManager::GetInstance().NotifyDisplayChanged(
|
||||
screenSession->ConvertToDisplayInfo(), DisplayChangeEvent::SUPER_FOLD_RESOLUTION_CHANGED);
|
||||
sptr<ScreenSession> fakeScreenSession = screenSession->GetFakeScreenSession();
|
||||
@ -226,11 +223,8 @@ void SuperFoldStateManager::HandleExtendToHalfFoldDisplayNotify(sptr<ScreenSessi
|
||||
|
||||
void SuperFoldStateManager::HandleHalfFoldToExtendDisplayNotify(sptr<ScreenSession> screenSession)
|
||||
{
|
||||
ScreenProperty screenProperty = screenSession->GetScreenProperty();
|
||||
uint32_t screenWidth = screenProperty.GetFakeBounds().rect_.GetWidth();
|
||||
uint32_t screenHeight = screenProperty.GetFakeBounds().rect_.GetHeight();
|
||||
screenSession->UpdatePropertyByResolution(screenWidth, screenHeight * HALF_SCREEN_PARAM);
|
||||
screenSession->UpdatePropertyByFakeInUse(false);
|
||||
screenSession->SetIsBScreenHalf(false);
|
||||
sptr<ScreenSession> fakeScreenSession = screenSession->GetFakeScreenSession();
|
||||
sptr<DisplayInfo> fakeDisplayInfo = fakeScreenSession->ConvertToDisplayInfo();
|
||||
if (fakeDisplayInfo == nullptr) {
|
||||
@ -249,6 +243,7 @@ void SuperFoldStateManager::HandleHalfFoldToExtendDisplayNotify(sptr<ScreenSessi
|
||||
void SuperFoldStateManager::HandleKeyboardOnDisplayNotify(sptr<ScreenSession> screenSession)
|
||||
{
|
||||
screenSession->UpdatePropertyByFakeInUse(false);
|
||||
screenSession->SetIsBScreenHalf(true);
|
||||
sptr<ScreenSession> fakeScreenSession = screenSession->GetFakeScreenSession();
|
||||
sptr<DisplayInfo> fakeDisplayInfo = fakeScreenSession->ConvertToDisplayInfo();
|
||||
if (fakeDisplayInfo == nullptr) {
|
||||
@ -264,6 +259,7 @@ void SuperFoldStateManager::HandleKeyboardOnDisplayNotify(sptr<ScreenSession> sc
|
||||
void SuperFoldStateManager::HandleKeyboardOffDisplayNotify(sptr<ScreenSession> screenSession)
|
||||
{
|
||||
screenSession->UpdatePropertyByFakeInUse(true);
|
||||
screenSession->SetIsBScreenHalf(true);
|
||||
sptr<ScreenSession> fakeScreenSession = screenSession->GetFakeScreenSession();
|
||||
ScreenSessionManager::GetInstance().NotifyDisplayCreate(
|
||||
fakeScreenSession->ConvertToDisplayInfo());
|
||||
|
@ -5199,6 +5199,10 @@ bool ScreenSessionManager::IsMultiScreenCollaboration()
|
||||
FoldStatus ScreenSessionManager::GetFoldStatus()
|
||||
{
|
||||
DmsXcollie dmsXcollie("DMS:GetFoldStatus", XCOLLIE_TIMEOUT_10S);
|
||||
if (FoldScreenStateInternel::IsSuperFoldDisplayDevice()) {
|
||||
SuperFoldStatus status = SuperFoldStateManager::GetInstance().GetCurrentStatus();
|
||||
return SuperFoldStateManager::GetInstance().MatchSuperFoldStatusToFoldStatus(status);
|
||||
}
|
||||
if (!g_foldScreenFlag) {
|
||||
return FoldStatus::UNKNOWN;
|
||||
}
|
||||
|
@ -163,7 +163,7 @@ private:
|
||||
RRect bounds_;
|
||||
RRect phyBounds_;
|
||||
RRect fakeBounds_;
|
||||
bool isFakeInUse_ = false;
|
||||
bool isFakeInUse_ = false; // is fake bounds in use
|
||||
|
||||
float scaleX_ { 1.0f };
|
||||
float scaleY_ { 1.0f };
|
||||
|
@ -209,6 +209,8 @@ public:
|
||||
bool GetIsCurrentInUse() const;
|
||||
void SetIsFakeInUse(bool isFakeInUse);
|
||||
bool GetIsFakeInUse() const;
|
||||
void SetIsBScreenHalf(bool isBScreenHalf);
|
||||
bool GetIsBScreenHalf() const;
|
||||
|
||||
bool isPrimary_ { false };
|
||||
bool isInternal_ { false };
|
||||
@ -263,7 +265,8 @@ private:
|
||||
ScreenCombination combination_ { ScreenCombination::SCREEN_ALONE };
|
||||
VirtualScreenFlag screenFlag_ { VirtualScreenFlag::DEFAULT };
|
||||
bool hasPrivateWindowForeground_ = false;
|
||||
bool isFakeInUse_ = false;
|
||||
bool isFakeInUse_ = false; // is fake session in use
|
||||
bool isBScreenHalf_ = false;
|
||||
bool isPhysicalMirrorSwitch_ = false;
|
||||
mutable std::shared_mutex displayNodeMutex_;
|
||||
std::atomic<bool> touchEnabled_ { true };
|
||||
|
@ -261,8 +261,14 @@ sptr<DisplayInfo> ScreenSession::ConvertToDisplayInfo()
|
||||
RRect bounds = property_.GetBounds();
|
||||
RRect phyBounds = property_.GetPhyBounds();
|
||||
displayInfo->name_ = name_;
|
||||
displayInfo->SetWidth(bounds.rect_.GetWidth());
|
||||
displayInfo->SetHeight(bounds.rect_.GetHeight());
|
||||
if (isBScreenHalf_) {
|
||||
displayInfo->SetWidth(bounds.rect_.GetWidth());
|
||||
displayInfo->SetHeight(bounds.rect_.GetHeight() / HALF_SCREEN_PARAM);
|
||||
} else {
|
||||
displayInfo->SetWidth(bounds.rect_.GetWidth());
|
||||
displayInfo->SetHeight(bounds.rect_.GetHeight());
|
||||
}
|
||||
|
||||
displayInfo->SetPhysicalWidth(phyBounds.rect_.GetWidth());
|
||||
displayInfo->SetPhysicalHeight(phyBounds.rect_.GetHeight());
|
||||
displayInfo->SetScreenId(screenId_);
|
||||
@ -348,6 +354,16 @@ bool ScreenSession::GetIsFakeInUse() const
|
||||
return isFakeInUse_;
|
||||
}
|
||||
|
||||
void ScreenSession::SetIsBScreenHalf(bool isBScreenHalf)
|
||||
{
|
||||
isBScreenHalf_ = isBScreenHalf;
|
||||
}
|
||||
|
||||
bool ScreenSession::GetIsBScreenHalf() const
|
||||
{
|
||||
return isBScreenHalf_;
|
||||
}
|
||||
|
||||
void ScreenSession::SetFakeScreenSession(sptr<ScreenSession> fakeScreenSession)
|
||||
{
|
||||
fakeScreenSession_ = fakeScreenSession;
|
||||
|
Loading…
Reference in New Issue
Block a user