Avoid crash when accessing the main windget position

This commit is contained in:
Klaus Basan
2019-04-27 14:32:29 +02:00
parent 3171bd5661
commit 242d6137e5
3 changed files with 11 additions and 6 deletions

View File

@@ -659,7 +659,7 @@ namespace BlackGui
QPoint pos = CGuiUtility::mainWidgetGlobalPosition();
if (pos.isNull())
{
pos = sGui->currentScreen()->geometry().center() - this->rect().center();
pos = CGuiApplication::currentScreen()->geometry().center() - this->rect().center();
}
const int x = pos.x() + m_offsetWhenFloating.x();