Commit f994e130 authored by Fushan Wen's avatar Fushan Wen Committed by Nate Graham
Browse files

shell/scripting: Consider current activity in `desktopForScreen`

This fixes "Change Wallpaper..." in System Settings unable to open the
config dialog when the current activity is not the default one.

BUG: 452561
parent ddcedbc0
Pipeline #165268 passed with stage
in 7 minutes and 47 seconds
......@@ -188,8 +188,10 @@ QJSValue ScriptEngine::V1::desktopForScreen(const QJSValue &param) const
const uint screen = param.toInt();
const auto containments = m_engine->m_corona->containmentsForScreen(screen);
return m_engine->wrap(containments.empty() ? nullptr : containments[0]);
// "null": don't create a containment if it doesn't exist,
// return nullptr instead.
const auto containment = m_engine->m_corona->containmentForScreen(screen, currentActivity(), QStringLiteral("null"));
return m_engine->wrap(containment);
QJSValue ScriptEngine::V1::screenForConnector(const QJSValue &param) const
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment