mirror of
https://github.com/openharmony/windowmanager.git
synced 2026-07-22 13:05:55 -04:00
check setWindowLayoutMode input param
Signed-off-by: jincanran <jincanran@huawei.com> Change-Id: I4d44082b454e653ca0257140258c75b46a4ae930
This commit is contained in:
@@ -112,8 +112,10 @@ enum class WindowSizeChangeReason : uint32_t {
|
||||
};
|
||||
|
||||
enum class WindowLayoutMode : uint32_t {
|
||||
CASCADE = 0,
|
||||
BASE = 0,
|
||||
CASCADE = BASE,
|
||||
TILE = 1,
|
||||
END,
|
||||
};
|
||||
|
||||
enum class DragEvent : uint32_t {
|
||||
|
||||
@@ -1017,6 +1017,10 @@ WMError WindowNodeContainer::SwitchLayoutPolicy(WindowLayoutMode dstMode, bool r
|
||||
{
|
||||
WLOGFI("SwitchLayoutPolicy src: %{public}d dst: %{public}d reorder: %{public}d",
|
||||
static_cast<uint32_t>(layoutMode_), static_cast<uint32_t>(dstMode), static_cast<uint32_t>(reorder));
|
||||
if (dstMode < WindowLayoutMode::BASE || dstMode >= WindowLayoutMode::END) {
|
||||
WLOGFE("invalid layout mode");
|
||||
return WMError::WM_ERROR_INVALID_PARAM;
|
||||
}
|
||||
if (layoutMode_ != dstMode) {
|
||||
if (layoutMode_ == WindowLayoutMode::CASCADE && !pairedWindowMap_.empty()) {
|
||||
pairedWindowMap_.clear();
|
||||
|
||||
Reference in New Issue
Block a user