Skip to content

Commit

Permalink
feat: DDE适配Treeland
Browse files Browse the repository at this point in the history
Treeland下,wm接口直接返回

Log: DDE适配Treeland
pms: TASK-361827
  • Loading branch information
ECQZXC committed Dec 13, 2024
1 parent f75060e commit 76360e8
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/dde-session/impl/wmswitcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// SPDX-License-Identifier: GPL-3.0-or-later

#include "wmswitcher.h"
#include "utils/utils.h"

#include <QDBusConnection>
#include <QDBusInterface>
Expand All @@ -24,16 +25,27 @@ WMSwitcher::WMSwitcher(QObject *parent)

bool WMSwitcher::AllowSwitch() const
{
return m_wmInter->compositingPossible();
if (Utils::IS_WAYLAND_DISPLAY) {
return false;
} else {
return m_wmInter->compositingPossible();
}
}

QString WMSwitcher::CurrentWM() const
{
return m_wmInter->compositingEnabled() ? WM_NAME_3D : WM_NAME_2D;
if (Utils::IS_WAYLAND_DISPLAY) {
return QString();
} else {
return m_wmInter->compositingEnabled() ? WM_NAME_3D : WM_NAME_2D;
}
}

void WMSwitcher::RequestSwitchWM() const
{
if (Utils::IS_WAYLAND_DISPLAY)
return;

showOSD("SwitchWM");
}

Expand Down

0 comments on commit 76360e8

Please sign in to comment.