shell: disconnect old `accentColorChanged` signal when primary screen is changed

Otherwise there will be many redundant signal bindings.
wilder-5.26
Fushan Wen 4 years ago
parent c6b01d7f9e
commit 7761926a1b
No known key found for this signature in database
GPG Key ID: 2E48D1487C91DCAA
  1. 3
      shell/shellcorona.cpp

@ -785,7 +785,8 @@ void ShellCorona::primaryScreenChanged(QScreen *oldPrimary, QScreen *newPrimary)
// CHECK_SCREEN_INVARIANTS
// refresh the accent color signal binding
connect(m_desktopViewForScreen[m_screenPool->primaryScreen()], &DesktopView::accentColorChanged, this, &ShellCorona::colorChanged);
disconnect(m_desktopViewForScreen.value(oldPrimary), &DesktopView::accentColorChanged, this, &ShellCorona::colorChanged);
connect(m_desktopViewForScreen.value(newPrimary), &DesktopView::accentColorChanged, this, &ShellCorona::colorChanged);
}
#ifndef NDEBUG

Loading…
Cancel
Save