Skip to content

Commit

Permalink
chore: quick dirty fix for TreeLand
Browse files Browse the repository at this point in the history
临时为 TreeLand 提供的修改。此提交后续应当回退。修改内容如下:

1. TreeLand 下默认全屏
2. 隐藏切换到窗口模式的按钮

Log:
  • Loading branch information
BLumia committed Jan 16, 2024
1 parent 4d55440 commit 8e7a02e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions desktopintegration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ void DesktopIntegration::launchByDesktopId(const QString &desktopId)
}
}

QString DesktopIntegration::environmentVariable(const QString &env)

Check warning on line 58 in desktopintegration.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

The function 'environmentVariable' is never used.
{
return qEnvironmentVariable(env.toStdString().c_str());
}

bool DesktopIntegration::appIsCompulsoryForDesktop(const QString &desktopId)

Check warning on line 63 in desktopintegration.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

The function 'appIsCompulsoryForDesktop' is never used.
{
if (m_compulsoryAppIdList.contains(desktopId)) return true;
Expand Down
1 change: 1 addition & 0 deletions desktopintegration.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class DesktopIntegration : public QObject
Q_INVOKABLE static void openShutdownScreen();
Q_INVOKABLE static void openSystemSettings();
Q_INVOKABLE static void launchByDesktopId(const QString & desktopId);
Q_INVOKABLE static QString environmentVariable(const QString & env);
Q_INVOKABLE bool appIsCompulsoryForDesktop(const QString & desktopId);
// TODO: async get wallpaper?

Expand Down
3 changes: 3 additions & 0 deletions launchercontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ LauncherController::LauncherController(QObject *parent)
QSettings settings(settingPath, QSettings::NativeFormat);

m_currentFrame = settings.value("current_frame", "WindowedFrame").toString();
if (qgetenv("DDE_CURRENT_COMPOSITER") == "TreeLand") {
m_currentFrame = QStringLiteral("FullscreenFrame");
}

m_timer->setInterval(500);
m_timer->setSingleShot(true);
Expand Down
2 changes: 2 additions & 0 deletions qml/FullscreenFrame.qml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ Control {
ToolButton {
id: exitFullscreenBtn

visible: (DesktopIntegration.environmentVariable("DDE_CURRENT_COMPOSITER") !== "TreeLand")

Accessible.name: "Exit fullscreen"

anchors.right: fullscreenHeader.right
Expand Down

0 comments on commit 8e7a02e

Please sign in to comment.