Skip to content

Commit

Permalink
fix: block some plugins under treeland
Browse files Browse the repository at this point in the history
Signed-off-by: ComixHe <heyuming@deepin.org>
  • Loading branch information
ComixHe committed Jan 18, 2024
1 parent 430a79b commit 9e1f7d3
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/frame/pluginmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,21 @@ PluginData loadPlugin(const QPair<PluginManager *, QString> &pair)
return data;
}

// FIXME: load all plugin under treeland
static QByteArray compositor = qgetenv("DDE_CURRENT_COMPOSITER");
static QStringList allowedUnderTreeland{ "accounts",
"display",
"systeminfo",
"Default Applications" };

if (compositor.compare("treeland", Qt::CaseInsensitive) == 0
and !allowedUnderTreeland.contains(plugin->name())) {
qCWarning(DdcFramePluginManager)
<< QString("plugin %1 has been banned under treeland.").arg(plugin->name());
loader->unload();
return data;
}

data.Plugin = plugin;
data.Follow = plugin->follow();
data.Location = plugin->location();
Expand Down

0 comments on commit 9e1f7d3

Please sign in to comment.