Skip to content

Commit

Permalink
fix: can't load plugin in debug build
Browse files Browse the repository at this point in the history
Log: ddm is started as user dde and cannot access other users' home directories
Fix: #388
  • Loading branch information
wineee authored and zccrs committed Feb 19, 2025
1 parent ed527f0 commit dbcff75
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/core/treeland.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,14 @@ Treeland::Treeland()
QDBusConnection::sessionBus().registerObject("/org/deepin/Compositor1", this);

#ifdef QT_DEBUG
d->loadPlugin(QStringLiteral(TREELAND_PLUGINS_OUTPUT_PATH));
QDir dir(QStringLiteral(TREELAND_PLUGINS_OUTPUT_PATH));
if (dir.exists() && dir.isReadable()) {
d->loadPlugin(QStringLiteral(TREELAND_PLUGINS_OUTPUT_PATH));
} else {
qInfo() << "The Treeland plugin build directory is inaccessible, failback to the "
"installation directory";
d->loadPlugin(QStringLiteral(TREELAND_PLUGINS_INSTALL_PATH));
}
#else
d->loadPlugin(QStringLiteral(TREELAND_PLUGINS_INSTALL_PATH));
#endif
Expand Down

0 comments on commit dbcff75

Please sign in to comment.