/* * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef OHOS_ROSEN_WINDOW_SESSION_IMPL_H #define OHOS_ROSEN_WINDOW_SESSION_IMPL_H #include #include #include #include #include #include #include #include #include #include "display_manager.h" #include "singleton_container.h" #include "common/include/window_session_property.h" #include "display_info.h" #include "future_callback.h" #include "interfaces/include/ws_common.h" #include "interfaces/include/ws_common_inner.h" #include "session/container/include/zidl/session_stage_stub.h" #include "session/host/include/zidl/session_interface.h" #include "vsync_station.h" #include "window.h" #include "window_option.h" #include "wm_common.h" namespace OHOS { namespace Rosen { namespace { template using EnableIfSame = typename std::enable_if, Ret>::type; /* * DFX */ const std::string SET_UICONTENT_TIMEOUT_LISTENER_TASK_NAME = "SetUIContentTimeoutListener"; constexpr int64_t SET_UICONTENT_TIMEOUT_TIME_MS = 4000; constexpr int64_t SET_UICONTENT_TIMEOUT_TIME_AFTER_FREEZE_MS = 5000; } struct WindowTitleVisibleFlags { bool isMaximizeVisible = true; bool isMinimizeVisible = true; bool isSplitVisible = true; bool isCloseVisible = true; }; class WindowSessionImpl : public Window, public virtual SessionStageStub { public: explicit WindowSessionImpl(const sptr& option); ~WindowSessionImpl(); void ConsumePointerEvent(const std::shared_ptr& pointerEvent) override; void ConsumeKeyEvent(std::shared_ptr& inputEvent) override; bool PreNotifyKeyEvent(const std::shared_ptr& keyEvent) override; virtual bool NotifyOnKeyPreImeEvent(const std::shared_ptr& keyEvent) override; static sptr Find(const std::string& name); static std::vector> GetSubWindow(int parentId); // inherits from window virtual WMError Create(const std::shared_ptr& context, const sptr& iSession, const std::string& identityToken = ""); WMError Show(uint32_t reason = 0, bool withAnimation = false, bool withFocus = true) override; WMError Hide(uint32_t reason = 0, bool withAnimation = false, bool isFromInnerkits = true) override; WMError Destroy() override; virtual WMError Destroy(bool needNotifyServer, bool needClearListener = true); WMError NapiSetUIContent(const std::string& contentInfo, napi_env env, napi_value storage, BackupAndRestoreType type, sptr token, AppExecFwk::Ability* ability) override; WMError SetUIContentByName(const std::string& contentInfo, napi_env env, napi_value storage, AppExecFwk::Ability* ability) override; WMError SetUIContentByAbc(const std::string& abcPath, napi_env env, napi_value storage, AppExecFwk::Ability* ability) override; std::shared_ptr GetSurfaceNode() const override; const std::shared_ptr GetContext() const override; Rect GetRequestRect() const override; WindowType GetType() const override; const std::string& GetWindowName() const override; WindowState GetWindowState() const override; WindowState GetRequestWindowState() const; WMError SetFocusable(bool isFocusable) override; WMError SetTouchable(bool isTouchable) override; /* * Window Hierarchy */ WMError SetTopmost(bool topmost) override; bool IsTopmost() const override; WMError SetMainWindowTopmost(bool isTopmost) override; bool IsMainWindowTopmost() const override; WMError SetResizeByDragEnabled(bool dragEnabled) override; WMError SetRaiseByClickEnabled(bool raiseEnabled) override; WMError HideNonSystemFloatingWindows(bool shouldHide) override; WMError SetSingleFrameComposerEnabled(bool enable) override; bool IsFloatingWindowAppType() const override; /* * PC Window */ bool IsPcWindow() const override; bool IsPcOrPadCapabilityEnabled() const override; bool IsPcOrPadFreeMultiWindowMode() const override; WMError SetTitleButtonVisible(bool isMaximizeVisible, bool isMinimizeVisible, bool isSplitVisible, bool isCloseVisible) override; WMError SetSubWindowModal(bool isModal, ModalityType modalityType = ModalityType::WINDOW_MODALITY) override; WMError SetWindowModal(bool isModal) override; void SetTargetAPIVersion(uint32_t targetAPIVersion); uint32_t GetTargetAPIVersion() const; WMError SetWindowType(WindowType type) override; WMError SetBrightness(float brightness) override; virtual float GetBrightness() const override; void SetRequestedOrientation(Orientation orientation) override; bool GetTouchable() const override; uint32_t GetWindowId() const override; uint64_t GetDisplayId() const override; Rect GetRect() const override; bool GetFocusable() const override; std::string GetContentInfo(BackupAndRestoreType type = BackupAndRestoreType::CONTINUATION) override; WMError SetRestoredRouterStack(const std::string& routerStack) override; Ace::UIContent* GetUIContent() const override; std::shared_ptr GetUIContentSharedPtr() const; Ace::UIContent* GetUIContentWithId(uint32_t winId) const override; void OnNewWant(const AAFwk::Want& want) override; WMError SetAPPWindowLabel(const std::string& label) override; WMError SetAPPWindowIcon(const std::shared_ptr& icon) override; void RequestVsync(const std::shared_ptr& vsyncCallback) override; int64_t GetVSyncPeriod() override; void FlushFrameRate(uint32_t rate, int32_t animatorExpectedFrameRate, uint32_t rateType = 0) override; // inherits from session stage WSError SetActive(bool active) override; WSError UpdateRect(const WSRect& rect, SizeChangeReason reason, const SceneAnimationConfig& config = { nullptr, ROTATE_ANIMATION_DURATION }) override; void UpdateDensity() override; void SetUniqueVirtualPixelRatio(bool useUniqueDensity, float virtualPixelRatio) override; WSError UpdateOrientation() override; WSError UpdateDisplayId(uint64_t displayId) override; WSError UpdateFocus(bool focus) override; bool IsFocused() const override; WMError RequestFocus() const override; WMError RequestFocusByClient(bool isFocused) const override; WSError UpdateWindowMode(WindowMode mode) override; WSError HandleBackEvent() override; WMError SetSystemBarProperty(WindowType type, const SystemBarProperty& property) override; KeyboardAnimationConfig GetKeyboardAnimationConfig() override; void NotifyPointerEvent(const std::shared_ptr& pointerEvent) override; void NotifyKeyEvent(const std::shared_ptr& keyEvent, bool& isConsumed, bool notifyInputMethod = true) override; void NotifyOccupiedAreaChangeInfoInner(sptr info); void NotifyOccupiedAreaChangeInfo(sptr info, const std::shared_ptr& rsTransaction = nullptr) override; void NotifyForegroundInteractiveStatus(bool interactive) override; void NotifyDisplayMove(DisplayId from, DisplayId to) override; WMError RegisterLifeCycleListener(const sptr& listener) override; WMError UnregisterLifeCycleListener(const sptr& listener) override; WMError RegisterDisplayMoveListener(sptr& listener) override; WMError UnregisterDisplayMoveListener(sptr& listener) override; WMError RegisterWindowChangeListener(const sptr& listener) override; WMError UnregisterWindowChangeListener(const sptr& listener) override; WMError RegisterAvoidAreaChangeListener(sptr& listener) override; WMError UnregisterAvoidAreaChangeListener(sptr& listener) override; void RegisterDialogDeathRecipientListener(const sptr& listener) override; void UnregisterDialogDeathRecipientListener(const sptr& listener) override; WMError RegisterDialogTargetTouchListener(const sptr& listener) override; WMError UnregisterDialogTargetTouchListener(const sptr& listener) override; WMError RegisterOccupiedAreaChangeListener(const sptr& listener) override; WMError UnregisterOccupiedAreaChangeListener(const sptr& listener) override; WMError RegisterTouchOutsideListener(const sptr& listener) override; WMError UnregisterTouchOutsideListener(const sptr& listener) override; WMError RegisterWindowVisibilityChangeListener(const IWindowVisibilityListenerSptr& listener) override; WMError UnregisterWindowVisibilityChangeListener(const IWindowVisibilityListenerSptr& listener) override; WMError RegisterDisplayIdChangeListener(const IDisplayIdChangeListenerSptr& listener) override; WMError UnregisterDisplayIdChangeListener(const IDisplayIdChangeListenerSptr& listener) override; WMError RegisterWindowNoInteractionListener(const IWindowNoInteractionListenerSptr& listener) override; WMError UnregisterWindowNoInteractionListener(const IWindowNoInteractionListenerSptr& listener) override; void RegisterWindowDestroyedListener(const NotifyNativeWinDestroyFunc& func) override; void UnregisterWindowDestroyedListener() override { notifyNativeFunc_ = nullptr; } WMError RegisterScreenshotListener(const sptr& listener) override; WMError UnregisterScreenshotListener(const sptr& listener) override; void SetAceAbilityHandler(const sptr& handler) override; void SetInputEventConsumer(const std::shared_ptr& inputEventConsumer) override; WMError SetBackgroundColor(const std::string& color) override; virtual Orientation GetRequestedOrientation() override; int32_t GetParentId() const; int32_t GetPersistentId() const override; sptr GetProperty() const; SystemSessionConfig GetSystemSessionConfig() const; sptr GetHostSession() const; int32_t GetFloatingWindowParentId(); void NotifyAfterForeground(bool needNotifyListeners = true, bool needNotifyUiContent = true); void NotifyAfterBackground(bool needNotifyListeners = true, bool needNotifyUiContent = true); void NotifyForegroundFailed(WMError ret); void NotifyBackgroundFailed(WMError ret); WSError MarkProcessed(int32_t eventId) override; void UpdateTitleButtonVisibility(); WSError NotifyDestroy() override; WSError NotifyTransferComponentData(const AAFwk::WantParams& wantParams) override; WSErrorCode NotifyTransferComponentDataSync(const AAFwk::WantParams& wantParams, AAFwk::WantParams& reWantParams) override; void NotifyAvoidAreaChange(const sptr& avoidArea, AvoidAreaType type); WSError UpdateAvoidArea(const sptr& avoidArea, AvoidAreaType type) override; void NotifyTouchDialogTarget(int32_t posX = 0, int32_t posY = 0) override; void NotifyScreenshot() override; void DumpSessionElementInfo(const std::vector& params) override; // colorspace, gamut virtual bool IsSupportWideGamut() override; virtual void SetColorSpace(ColorSpace colorSpace) override; virtual ColorSpace GetColorSpace() override; WSError NotifyTouchOutside() override; WMError SetLandscapeMultiWindow(bool isLandscapeMultiWindow) override; WSError NotifyWindowVisibility(bool isVisible) override; WSError NotifyNoInteractionTimeout(const IWindowNoInteractionListenerSptr& listener); WMError TransferAccessibilityEvent(const Accessibility::AccessibilityEventInfo& info, int64_t uiExtensionIdLevel) override; WindowState state_ { WindowState::STATE_INITIAL }; WindowState requestState_ { WindowState::STATE_INITIAL }; WSError UpdateMaximizeMode(MaximizeMode mode) override; void NotifySessionForeground(uint32_t reason, bool withAnimation) override; void NotifySessionBackground(uint32_t reason, bool withAnimation, bool isFromInnerkits) override; WSError UpdateTitleInTargetPos(bool isShow, int32_t height) override; WSError NotifyDialogStateChange(bool isForeground) override; bool IsMainHandlerAvailable() const override; /* * PiP Window */ WSError NotifyCloseExistPipWindow() override; WSError SetPipActionEvent(const std::string& action, int32_t status) override; WSError SetPiPControlEvent(WsPiPControlType controlType, WsPiPControlStatus status) override; void UpdatePiPRect(const Rect& rect, WindowSizeChangeReason reason) override; void UpdatePiPControlStatus(PiPControlType controlType, PiPControlStatus status) override; void SetAutoStartPiP(bool isAutoStart, uint32_t priority) override; void SetDrawingContentState(bool drawingContentState); WMError RegisterWindowStatusChangeListener(const sptr& listener) override; WMError UnregisterWindowStatusChangeListener(const sptr& listener) override; WMError SetSpecificBarProperty(WindowType type, const SystemBarProperty& property) override; virtual WMError SetDecorVisible(bool isVisible) override; virtual WMError SetWindowTitleMoveEnabled(bool enable) override; virtual WMError SetDecorHeight(int32_t decorHeight) override; virtual WMError GetDecorHeight(int32_t& height) override; virtual WMError GetTitleButtonArea(TitleButtonRect& titleButtonRect) override; WSError GetUIContentRemoteObj(sptr& uiContentRemoteObj) override; virtual WMError RegisterWindowTitleButtonRectChangeListener( const sptr& listener) override; virtual WMError UnregisterWindowTitleButtonRectChangeListener( const sptr& listener) override; void NotifyWindowTitleButtonRectChange(TitleButtonRect titleButtonRect); void RecoverSessionListener(); void SetDefaultDisplayIdIfNeed(); WMError RegisterWindowRectChangeListener(const sptr& listener) override; WMError UnregisterWindowRectChangeListener(const sptr& listener) override; WMError RegisterSubWindowCloseListeners(const sptr& listener) override; WMError UnregisterSubWindowCloseListeners(const sptr& listener) override; WMError RegisterMainWindowCloseListeners(const sptr& listener) override; WMError UnregisterMainWindowCloseListeners(const sptr& listener) override; WMError RegisterSwitchFreeMultiWindowListener(const sptr& listener) override; WMError UnregisterSwitchFreeMultiWindowListener(const sptr& listener) override; virtual WMError GetCallingWindowWindowStatus(WindowStatus& windowStatus) const override; virtual WMError GetCallingWindowRect(Rect& rect) const override; virtual void SetUiDvsyncSwitch(bool dvsyncSwitch) override; WMError SetContinueState(int32_t continueState) override; /* * Window Layout */ WMError EnableDrag(bool enableDrag) override; WSError SetEnableDragBySystem(bool enableDrag) override; /* * Window Property */ WSError NotifyDisplayIdChange(DisplayId displayId); protected: WMError Connect(); bool IsWindowSessionInvalid() const; void NotifyWindowAfterUnfocused(); void NotifyWindowAfterFocused(); void NotifyAfterActive(); void NotifyAfterInactive(); void NotifyBeforeDestroy(std::string windowName); void NotifyAfterDestroy(); void ClearListenersById(int32_t persistentId); void ClearSwitchFreeMultiWindowListenersById(int32_t persistentId); void ClearVsyncStation(); WMError WindowSessionCreateCheck(); void UpdateDecorEnableToAce(bool isDecorEnable); void UpdateDecorEnable(bool needNotify = false, WindowMode mode = WindowMode::WINDOW_MODE_UNDEFINED); void NotifyModeChange(WindowMode mode, bool hasDeco = true); WMError UpdateProperty(WSPropertyChangeAction action); WMError SetBackgroundColor(uint32_t color); uint32_t GetBackgroundColor() const; virtual WMError SetLayoutFullScreenByApiVersion(bool status); float GetVirtualPixelRatio() override; virtual float GetVirtualPixelRatio(sptr displayInfo); void UpdateViewportConfig(const Rect& rect, WindowSizeChangeReason reason, const std::shared_ptr& rsTransaction = nullptr, const sptr& info = nullptr, const std::map& avoidAreas = {}); void NotifySizeChange(Rect rect, WindowSizeChangeReason reason); void NotifySubWindowClose(bool& terminateCloseProcess); WMError NotifyMainWindowClose(bool& terminateCloseProcess); void NotifySwitchFreeMultiWindow(bool enable); static sptr FindWindowById(uint32_t winId); void NotifyWindowStatusChange(WindowMode mode); void NotifyTransformChange(const Transform& transForm) override; bool IsKeyboardEvent(const std::shared_ptr& keyEvent) const; void DispatchKeyEventCallback(const std::shared_ptr& keyEvent, bool& isConsumed); bool FilterKeyEvent(const std::shared_ptr& keyEvent); void CopyUniqueDensityParameter(sptr parentWindow); sptr FindMainWindowWithContext(); sptr FindExtensionWindowWithContext(); WMError RegisterExtensionAvoidAreaChangeListener(sptr& listener); WMError UnregisterExtensionAvoidAreaChangeListener(sptr& listener); void RefreshNoInteractionTimeoutMonitor(); WindowStatus GetWindowStatusInner(WindowMode mode); /** * Sub Window */ void UpdateSubWindowStateAndNotify(int32_t parentPersistentId, const WindowState newState); void DestroySubWindow(); sptr hostSession_; mutable std::mutex hostSessionMutex_; std::shared_ptr uiContent_; mutable std::shared_mutex uiContentMutex_; std::shared_ptr context_; std::shared_ptr surfaceNode_; sptr property_; SystemSessionConfig windowSystemConfig_; NotifyNativeWinDestroyFunc notifyNativeFunc_; std::recursive_mutex mutex_; static std::map>> windowSessionMap_; // protect windowSessionMap_ static std::shared_mutex windowSessionMutex_; static std::set> windowExtensionSessionSet_; // protect windowExtensionSessionSet_ static std::shared_mutex windowExtensionSessionMutex_; static std::map>> subWindowSessionMap_; bool isSystembarPropertiesSet_ = false; bool isIgnoreSafeAreaNeedNotify_ = false; bool isIgnoreSafeArea_ = false; std::atomic_bool isFocused_ = false; std::shared_ptr handler_ = nullptr; bool shouldReNotifyFocus_ = false; std::shared_ptr vsyncStation_ = nullptr; std::shared_ptr inputEventConsumer_; bool useUniqueDensity_ { false }; float virtualPixelRatio_ { 1.0f }; bool escKeyEventTriggered_ = false; // Check whether the UIExtensionAbility process is started static bool isUIExtensionAbilityProcess_; virtual WMError SetKeyEventFilter(KeyEventFilterFunc filter) override; virtual WMError ClearKeyEventFilter() override; WSError SwitchFreeMultiWindow(bool enable) override; std::string identityToken_ = { "" }; void MakeSubOrDialogWindowDragableAndMoveble(); bool IsFreeMultiWindowMode() const { return windowSystemConfig_.IsFreeMultiWindowMode(); } /* * DFX */ void SetUIContentComplete(); void AddSetUIContentTimeoutCheck(); void NotifySetUIContentComplete(); virtual void NotifyExtensionTimeout(int32_t errorCode) {} std::atomic_bool setUIContentCompleted_ { false }; void SetUIExtensionDestroyComplete(); void SetUIExtensionDestroyCompleteInSubWindow(); void AddSetUIExtensionDestroyTimeoutCheck(); std::atomic_bool setUIExtensionDestroyCompleted_ { false }; std::atomic_bool startUIExtensionDestroyTimer_ { false }; enum TimeoutErrorCode : int32_t { SET_UICONTENT_TIMEOUT = 1000, SET_UIEXTENSION_DESTROY_TIMEOUT }; /* * Window Lifecycle */ bool hasFirstNotifyInteractive_ = false; bool interactive_ = true; /* * Window Layout */ void FlushLayoutSize(int32_t width, int32_t height) override; sptr layoutCallback_ = nullptr; void UpdateVirtualPixelRatio(const sptr& display); private: //Trans between colorGamut and colorSpace static ColorSpace GetColorSpaceFromSurfaceGamut(GraphicColorGamut colorGamut); static GraphicColorGamut GetSurfaceGamutFromColorSpace(ColorSpace colorSpace); template WMError RegisterListener(std::vector>& holder, const sptr& listener); template WMError UnregisterListener(std::vector>& holder, const sptr& listener); template EnableIfSame>> GetListeners(); template EnableIfSame>> GetListeners(); template EnableIfSame>> GetListeners(); template EnableIfSame>> GetListeners(); template EnableIfSame>> GetListeners(); template EnableIfSame>> GetListeners(); template EnableIfSame>> GetListeners(); template EnableIfSame>> GetListeners(); template EnableIfSame>> GetListeners(); template EnableIfSame> GetListeners(); template EnableIfSame> GetListeners(); template EnableIfSame> GetListeners(); template EnableIfSame>> GetListeners(); template void ClearUselessListeners(std::map& listeners, int32_t persistentId); RSSurfaceNode::SharedPtr CreateSurfaceNode(std::string name, WindowType type); template EnableIfSame>> GetListeners(); template EnableIfSame>> GetListeners(); template EnableIfSame> GetListeners(); template EnableIfSame> GetListeners(); template EnableIfSame>> GetListeners(); void NotifyAfterFocused(); void NotifyUIContentFocusStatus(); void NotifyAfterUnfocused(bool needNotifyUiContent = true); void NotifyAfterResumed(); void NotifyAfterPaused(); WMError InitUIContent(const std::string& contentInfo, napi_env env, napi_value storage, WindowSetUIContentType setUIContentType, BackupAndRestoreType restoreType, AppExecFwk::Ability* ability, OHOS::Ace::UIContentErrorCode& aceRet); WMError SetUIContentInner(const std::string& contentInfo, napi_env env, napi_value storage, WindowSetUIContentType setUIContentType, BackupAndRestoreType restoreType, AppExecFwk::Ability* ability); std::shared_ptr> GetAbcContent(const std::string& abcPath); inline void DestroyExistUIContent(); std::string GetRestoredRouterStack(); void UpdateRectForRotation(const Rect& wmRect, const Rect& preRect, WindowSizeChangeReason wmReason, const SceneAnimationConfig& config); void UpdateRectForOtherReason(const Rect& wmRect, const Rect& preRect, WindowSizeChangeReason wmReason, const std::shared_ptr& rsTransaction = nullptr); void UpdateRectForOtherReasonTask(const Rect& wmRect, const Rect& preRect, WindowSizeChangeReason wmReason, const std::shared_ptr& rsTransaction); void NotifyRotationAnimationEnd(); void SubmitNoInteractionMonitorTask(int32_t eventId, const IWindowNoInteractionListenerSptr& listener); bool IsUserOrientation(Orientation orientation) const; WMError GetAppForceLandscapeConfig(AppForceLandscapeConfig& config); void SetForceSplitEnable(bool isForceSplit, const std::string& homePage = ""); void SetFrameLayoutCallbackEnable(bool enable); void UpdateFrameLayoutCallbackIfNeeded(WindowSizeChangeReason wmReason); void SetUniqueVirtualPixelRatioForSub(bool useUniqueDensity, float virtualPixelRatio); bool IsNotifyInteractiveDuplicative(bool interactive); /* * PC Window */ void GetTitleButtonVisible(bool& hideMaximizeButton, bool& hideMinimizeButton, bool& hideSplitButton, bool& hideCloseButton); static std::recursive_mutex lifeCycleListenerMutex_; static std::recursive_mutex windowChangeListenerMutex_; static std::recursive_mutex avoidAreaChangeListenerMutex_; static std::recursive_mutex dialogDeathRecipientListenerMutex_; static std::recursive_mutex dialogTargetTouchListenerMutex_; static std::recursive_mutex occupiedAreaChangeListenerMutex_; static std::recursive_mutex screenshotListenerMutex_; static std::recursive_mutex touchOutsideListenerMutex_; static std::recursive_mutex windowVisibilityChangeListenerMutex_; static std::recursive_mutex windowNoInteractionListenerMutex_; static std::recursive_mutex windowStatusChangeListenerMutex_; static std::recursive_mutex windowTitleButtonRectChangeListenerMutex_; static std::mutex displayMoveListenerMutex_; static std::mutex windowRectChangeListenerMutex_; static std::mutex subWindowCloseListenersMutex_; static std::mutex mainWindowCloseListenersMutex_; static std::mutex switchFreeMultiWindowListenerMutex_; static std::map>> lifecycleListeners_; static std::map>> displayMoveListeners_; static std::map>> windowChangeListeners_; static std::map>> avoidAreaChangeListeners_; static std::map>> dialogDeathRecipientListeners_; static std::map>> dialogTargetTouchListener_; static std::map>> occupiedAreaChangeListeners_; static std::map>> screenshotListeners_; static std::map>> touchOutsideListeners_; static std::map> windowVisibilityChangeListeners_; static std::mutex displayIdChangeListenerMutex_; static std::map> displayIdChangeListeners_; static std::map> windowNoInteractionListeners_; static std::map>> windowStatusChangeListeners_; static std::map>> windowTitleButtonRectChangeListeners_; static std::map>> windowRectChangeListeners_; static std::map> subWindowCloseListeners_; static std::map> mainWindowCloseListeners_; static std::map>> switchFreeMultiWindowListeners_; // FA only sptr aceAbilityHandler_; std::atomic lastInteractionEventId_ { 0 }; bool isMainHandlerAvailable_ = true; std::string subWindowTitle_ = { "" }; std::string dialogTitle_ = { "" }; std::shared_mutex keyEventFilterMutex_; KeyEventFilterFunc keyEventFilter_; WindowTitleVisibleFlags windowTitleVisibleFlags_; sptr windowOption_; std::string restoredRouterStack_; // It was set and get in same thread, which is js thread. /* * Window Layout */ WSRect layoutRect_; std::atomic_bool windowSizeChanged_ = false; std::atomic_bool enableFrameLayoutFinishCb_ = false; WindowSizeChangeReason lastSizeChangeReason_ = WindowSizeChangeReason::END; bool postTaskDone_ = false; int16_t rotationAnimationCount_ { 0 }; /* * PC Window */ uint32_t targetAPIVersion_ = 0; }; } // namespace Rosen } // namespace OHOS #endif // OHOS_ROSEN_WINDOW_SESSION_IMPL_H