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

Reviewed-By: d_ed
Reviewed-By: einar77
wilder-5.14
Kai Uwe Broulik 11 years ago
parent f3aa06cc99
commit d3fcccfb3d
  1. 10
      ksmserver/screenlocker/greeter/greeterapp.cpp
  2. 2
      ksmserver/screenlocker/greeter/greeterapp.h

@ -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:

Loading…
Cancel
Save