From 29dca599331c58361a9cb234f4ed665202dceec9 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Thu, 1 Apr 2021 20:06:32 +1100 Subject: [PATCH] fixed issue where autorecovery would show even after startup --- app/window/mainwindow/mainwindow.cpp | 12 +++++------- app/window/mainwindow/mainwindow.h | 4 +--- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/app/window/mainwindow/mainwindow.cpp b/app/window/mainwindow/mainwindow.cpp index 89838fee9..69d81309c 100644 --- a/app/window/mainwindow/mainwindow.cpp +++ b/app/window/mainwindow/mainwindow.cpp @@ -50,9 +50,7 @@ MainWindow::MainWindow(QWidget *parent) : taskbar_interface_ = nullptr; #endif -#ifdef Q_OS_LINUX - checked_graphics_vendor_ = false; -#endif + first_show_ = true; // Create empty central widget - we don't actually want a central widget (so we set its maximum // size to 0,0) but some of Qt's docking/undocking fails without it @@ -635,10 +633,10 @@ void MainWindow::showEvent(QShowEvent *e) { QMainWindow::showEvent(e); - QMetaObject::invokeMethod(Core::instance(), "CheckForAutoRecoveries", Qt::QueuedConnection); + if (first_show_) { + QMetaObject::invokeMethod(Core::instance(), "CheckForAutoRecoveries", Qt::QueuedConnection); #ifdef Q_OS_LINUX - if (!checked_graphics_vendor_) { // Check for nouveau since that driver really doesn't work with Olive QOffscreenSurface surface; surface.create(); @@ -651,9 +649,9 @@ void MainWindow::showEvent(QShowEvent *e) QMetaObject::invokeMethod(this, "ShowNouveauWarning", Qt::QueuedConnection); } - checked_graphics_vendor_ = true; - } + first_show_ = false; #endif + } } template diff --git a/app/window/mainwindow/mainwindow.h b/app/window/mainwindow/mainwindow.h index 19760b8bf..68c34a01c 100644 --- a/app/window/mainwindow/mainwindow.h +++ b/app/window/mainwindow/mainwindow.h @@ -156,9 +156,7 @@ private: ITaskbarList3* taskbar_interface_; #endif -#ifdef Q_OS_LINUX - bool checked_graphics_vendor_; -#endif + bool first_show_; private slots: void FocusedPanelChanged(PanelWidget* panel);