Commit 35d27fb2 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

(cherry picked from commit f994e130)
parent 984e0148
Pipeline #165271 passed with stage
in 11 minutes and 43 seconds
...@@ -188,8 +188,10 @@ QJSValue ScriptEngine::V1::desktopForScreen(const QJSValue &param) const ...@@ -188,8 +188,10 @@ QJSValue ScriptEngine::V1::desktopForScreen(const QJSValue &param) const
} }
const uint screen = param.toInt(); const uint screen = param.toInt();
const auto containments = m_engine->m_corona->containmentsForScreen(screen); // "null": don't create a containment if it doesn't exist,
return m_engine->wrap(containments.empty() ? nullptr : containments[0]); // 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 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