Commit 2eb89785 authored by Fushan Wen's avatar Fushan Wen
Browse files

wallpapers/image: fix wrong usage of `std::bind`

`m_virtualDesktopInfo->currentDesktop()` will be regarded as a static
value in `std::bind`, which prevents the current desktop from being
updated, so use lambda instead.

BUG: 459199
FIXED-IN: 5.26


(cherry picked from commit eb348312)
parent df793b9b
Pipeline #232998 passed with stage
in 25 minutes and 34 seconds
......@@ -50,16 +50,14 @@ void MaximizedWindowMonitor::Private::init()
q->setGroupMode(GroupMode::GroupDisabled);
q->setActivity(m_activityInfo->currentActivity());
q->connect(m_activityInfo,
&TaskManager::ActivityInfo::currentActivityChanged,
q,
std::bind(&MaximizedWindowMonitor::setActivity, q, m_activityInfo->currentActivity()));
q->connect(m_activityInfo, &TaskManager::ActivityInfo::currentActivityChanged, q, [this] {
q->setActivity(m_activityInfo->currentActivity());
});
q->setVirtualDesktop(m_virtualDesktopInfo->currentDesktop());
q->connect(m_virtualDesktopInfo,
&TaskManager::VirtualDesktopInfo::currentDesktopChanged,
q,
std::bind(&MaximizedWindowMonitor::setVirtualDesktop, q, m_virtualDesktopInfo->currentDesktop()));
q->connect(m_virtualDesktopInfo, &TaskManager::VirtualDesktopInfo::currentDesktopChanged, q, [this]() {
q->setVirtualDesktop(m_virtualDesktopInfo->currentDesktop());
});
q->setFilterByActivity(true);
q->setFilterByVirtualDesktop(true);
......
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