Commit a53df66b authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇

Fix crash on multiscreen setups by not relying on sender()

Reviewed-By: d_ed
Reviewed-By: einar77
parent 66b8401c
......@@ -255,14 +255,16 @@ void UnlockApp::desktopResized()
view->showFullScreen();
}
view->raise();
connect(view, &QQuickWindow::frameSwapped, this, &UnlockApp::markViewsAsVisible, Qt::QueuedConnection);
connect(view, &QQuickWindow::frameSwapped, this, [this, view] {
markViewsAsVisible(view);
}, Qt::QueuedConnection);
}
}
void UnlockApp::markViewsAsVisible()
void UnlockApp::markViewsAsVisible(KQuickAddons::QuickViewSharedEngine *view)
{
auto *view = qobject_cast<KQuickAddons::QuickViewSharedEngine *>(sender());
disconnect(view, &QQuickWindow::frameSwapped, this, &UnlockApp::markViewsAsVisible);
disconnect(view, &QQuickWindow::frameSwapped, this, 0);
QQmlProperty showProperty(view->rootObject(), QStringLiteral("viewVisible"));
showProperty.write(true);
// random state update, actually rather required on init only
......
......@@ -72,7 +72,7 @@ private Q_SLOTS:
void suspendToRam();
void suspendToDisk();
void getFocus();
void markViewsAsVisible();
void markViewsAsVisible(KQuickAddons::QuickViewSharedEngine *view);
void setLockedPropertyOnViews();
private:
......
Markdown is supported
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