diff --git a/desktopintegration.cpp b/desktopintegration.cpp index 9368816b..ef46d1c4 100644 --- a/desktopintegration.cpp +++ b/desktopintegration.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -28,7 +29,7 @@ QString DesktopIntegration::currentDE() bool DesktopIntegration::isTreeLand() { - return qEnvironmentVariable("DDE_CURRENT_COMPOSITOR") == QStringLiteral("TreeLand"); + return QGuiApplication::platformName() == "wayland"; } void DesktopIntegration::openShutdownScreen() diff --git a/launchercontroller.cpp b/launchercontroller.cpp index 041360cb..0e0b7faf 100644 --- a/launchercontroller.cpp +++ b/launchercontroller.cpp @@ -11,6 +11,7 @@ #include #include #include +#include "desktopintegration.h" DGUI_USE_NAMESPACE @@ -28,9 +29,6 @@ LauncherController::LauncherController(QObject *parent) QSettings settings(settingPath, QSettings::NativeFormat); m_currentFrame = settings.value("current_frame", "WindowedFrame").toString(); - if (qgetenv("DDE_CURRENT_COMPOSITOR") == "TreeLand") { - m_currentFrame = QStringLiteral("FullscreenFrame"); - } // Interval set to 500=>1000ms for issue https://github.com/linuxdeepin/developer-center/issues/8137 m_timer->setInterval(1000); diff --git a/qml/windowed/BottomBar.qml b/qml/windowed/BottomBar.qml index cc089c80..2b3cd0a7 100644 --- a/qml/windowed/BottomBar.qml +++ b/qml/windowed/BottomBar.qml @@ -31,6 +31,8 @@ Control { ToolTip.delay: 1000 ToolTip.text: qsTr("Power") Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter + // TODO: remove this when treeland is supported + visible: !DesktopIntegration.isTreeLand() onClicked: { DesktopIntegration.openShutdownScreen(); }