Fix testModifierOnlyShortcut
If a window is destroyed before the frame is presented, the window pointer will be dangling. In order to make kwin handle that case correctly, the window is captured using a QPointer.
This commit is contained in:
parent
e7959b9693
commit
f9b7d5298b
1 changed files with 9 additions and 6 deletions
|
@ -783,12 +783,15 @@ WaylandServer::LockScreenPresentationWatcher::LockScreenPresentationWatcher(Wayl
|
|||
{
|
||||
connect(server, &WaylandServer::windowAdded, this, [this](Window *window) {
|
||||
if (window->isLockScreen()) {
|
||||
connect(window->output()->renderLoop(), &RenderLoop::framePresented, this, [this, window]() {
|
||||
// only signal lockScreenShown once all outputs have been presented at least once
|
||||
m_signaledOutputs << window->output();
|
||||
if (m_signaledOutputs.size() == kwinApp()->platform()->enabledOutputs().size()) {
|
||||
ScreenLocker::KSldApp::self()->lockScreenShown();
|
||||
delete this;
|
||||
// only signal lockScreenShown once all outputs have been presented at least once
|
||||
connect(window->output()->renderLoop(), &RenderLoop::framePresented, this, [this, windowGuard = QPointer(window)]() {
|
||||
// window might be destroyed before a frame is presented, so it's wrapped in QPointer
|
||||
if (windowGuard) {
|
||||
m_signaledOutputs << windowGuard->output();
|
||||
if (m_signaledOutputs.size() == kwinApp()->platform()->enabledOutputs().size()) {
|
||||
ScreenLocker::KSldApp::self()->lockScreenShown();
|
||||
delete this;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue