diff options
author | WaluigiWare64 <68647953+WaluigiWare64@users.noreply.github.com> | 2021-01-29 16:05:51 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-29 16:05:51 +0000 |
commit | f9e701a719413469be4295909bd020b48873fb25 (patch) | |
tree | 9c06ad80f3fd3044ab205ecadacf1d423fd20975 /src/frontend/qt_sdl/main.cpp | |
parent | a3f4aaf50314f6ab528afb8dbcef88cfb012e765 (diff) |
Initialise cursor hiding timer before potential deletion of ScreenPanelGL
Diffstat (limited to 'src/frontend/qt_sdl/main.cpp')
-rw-r--r-- | src/frontend/qt_sdl/main.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/frontend/qt_sdl/main.cpp b/src/frontend/qt_sdl/main.cpp index 240d52e..6766252 100644 --- a/src/frontend/qt_sdl/main.cpp +++ b/src/frontend/qt_sdl/main.cpp @@ -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) |