Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adapt treeland #99

Merged
merged 1 commit into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,14 @@ bool Application::isWaylandPlatform()
return true;
}

/**
* @return 返回当前桌面环境为 Treeland
*/
bool Application::isTreeland()
{
return qEnvironmentVariable("DDE_CURRENT_COMPOSITOR") == QStringLiteral("TreeLand");
}

bool Application::isTabletSystemEnvir()
{
//#if (DTK_VERSION > DTK_VERSION_CHECK(5, 5, 0, 0))
Expand Down
1 change: 1 addition & 0 deletions src/application.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ class Application : public QObject
static void setWidgetAccesibleName(QWidget *w, const QString &name);

static bool isWaylandPlatform();
static bool isTreeland();

static bool isTabletSystemEnvir();

Expand Down
2 changes: 1 addition & 1 deletion src/deepin-draw/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ int main(int argc, char *argv[])
DWIDGET_INIT_RESOURCE();
#endif

if (Application::isWaylandPlatform()) {
if (Application::isWaylandPlatform() && !Application::isTreeland()) {
//添加kwayland-shell,修改了窗口顶部栏无右键菜单
qputenv("QT_WAYLAND_SHELL_INTEGRATION", "kwayland-shell");
}
Expand Down
Loading