Initialise cursor hiding timer before potential deletion of ScreenPanelGL

This commit is contained in:
WaluigiWare64
2021-01-29 16:05:51 +00:00
committed by GitHub
parent a3f4aaf503
commit f9e701a719

View File

@ -1431,6 +1431,11 @@ void MainWindow::createScreenPanel()
{
panelGL = new ScreenPanelGL(this);
panelGL->show();
panel = panelGL;
panelGL->setMouseTracking(true);
mouseTimer = panelGL->setupMouseTimer();
connect(mouseTimer, &QTimer::timeout, [=] { if (Config::MouseHide) panelGL->setCursor(Qt::BlankCursor);});
if (!panelGL->isValid())
hasOGL = false;
@ -1443,14 +1448,6 @@ void MainWindow::createScreenPanel()
if (!hasOGL)
delete panelGL;
if (hasOGL)
{
panel = panelGL;
panelGL->setMouseTracking(true);
mouseTimer = panelGL->setupMouseTimer();
connect(mouseTimer, &QTimer::timeout, [=] { if (Config::MouseHide) panelGL->setCursor(Qt::BlankCursor);});
}
}
if (!hasOGL)