diff options
author | Jan Holthuis <jholthuis@mixxx.org> | 2021-07-16 11:59:49 +0200 |
---|---|---|
committer | Jan Holthuis <jholthuis@mixxx.org> | 2021-07-16 12:40:24 +0200 |
commit | b4e905519d95f2423bc7144fa401dc5ff366bd01 (patch) | |
tree | 544574e90804cc1dbcabd3c5e847e42f2da27cc3 /src/preferences | |
parent | 6cf01185aaa77a52f19ad1bc299bfd6824e640bd (diff) |
DlgPrefInterface: Acquire primary screen for QGuiApplication
We can't have any references to the `MixxxMainWindow` class in
`DlgPrefInterface` if we want to use the preferences for QML skins that
don't have a `MixxxMainWindow` instance. The using the primary screen is
a sensible fallback.
Diffstat (limited to 'src/preferences')
-rw-r--r-- | src/preferences/dialog/dlgprefinterface.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/preferences/dialog/dlgprefinterface.cpp b/src/preferences/dialog/dlgprefinterface.cpp index 3a1d62dc5c..f4500912f4 100644 --- a/src/preferences/dialog/dlgprefinterface.cpp +++ b/src/preferences/dialog/dlgprefinterface.cpp @@ -190,10 +190,9 @@ QScreen* DlgPrefInterface::getScreen() const { auto* pScreen = mixxx::widgethelper::getScreen(*this); if (!pScreen) { - // Obtain the screen from the main widget as a fallback. This - // is necessary if no window is available before the widget - // is displayed. - pScreen = mixxx::widgethelper::getScreen(*m_mixxx); + // Obtain the primary screen. This is necessary if no window is + // available before the widget is displayed. + pScreen = qGuiApp->primaryScreen(); } DEBUG_ASSERT(pScreen); return pScreen; |