void-packages/srcpkgs/nextcloud-client/patches/fallback-primary-screen.patch

16 lines
872 B
Diff
Raw Normal View History

upstream: https://github.com/nextcloud/desktop/commit/aadee15008ca4974e542f3fb6ca1694592d9e6fe
--- src/gui/wizard/owncloudwizard.cpp
+++ src/gui/wizard/owncloudwizard.cpp
@@ -116,7 +116,10 @@ OwncloudWizard::OwncloudWizard(QWidget *parent)
void OwncloudWizard::centerWindow()
{
const auto wizardWindow = window();
- const auto screenGeometry = QGuiApplication::screenAt(wizardWindow->pos())->geometry();
+ const auto screen = QGuiApplication::screenAt(wizardWindow->pos())
+ ? QGuiApplication::screenAt(wizardWindow->pos())
+ : QGuiApplication::primaryScreen();
+ const auto screenGeometry = screen->geometry();
const auto windowGeometry = wizardWindow->geometry();
const auto newWindowPosition = screenGeometry.center() - QPoint(windowGeometry.width() / 2, windowGeometry.height() / 2);
wizardWindow->move(newWindowPosition);