diff options
| author | TryTwo <taolas@gmail.com> | 2024-06-23 10:49:14 -0700 |
|---|---|---|
| committer | TryTwo <taolas@gmail.com> | 2024-06-23 10:49:14 -0700 |
| commit | 81fc60f88802aa9fa5f92ebe6bf7f3c824880632 (patch) | |
| tree | 83c7bb38fae189b14fb3633f7482b8ef77c3ee74 /Source/Core/DolphinQt/MainWindow.cpp | |
| parent | 2aec195ec8b0fe0d603ca95370757c1acc46c7f2 (diff) | |
MainWindow: Remove Show() and redistribute its logic to other places.
bugfix: SetQWidgetWindowDecorations(this); not called before show() for Windows darkmode titlebars.
The actual call to (QWidget) show() needed to come sooner. Show() was originally left alone, but with other checks needing to move with (QWidget) show(), this function became less useful. Show() was originally created to fix the render widget appearing behind the main window, but that appears to work fine in this iteration.
Diffstat (limited to 'Source/Core/DolphinQt/MainWindow.cpp')
| -rw-r--r-- | Source/Core/DolphinQt/MainWindow.cpp | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/Source/Core/DolphinQt/MainWindow.cpp b/Source/Core/DolphinQt/MainWindow.cpp index 0bef377f07..3cc51ac5f3 100644 --- a/Source/Core/DolphinQt/MainWindow.cpp +++ b/Source/Core/DolphinQt/MainWindow.cpp @@ -240,7 +240,10 @@ MainWindow::MainWindow(std::unique_ptr<BootParameters> boot_parameters, restoreState(settings.value(QStringLiteral("mainwindow/state")).toByteArray()); restoreGeometry(settings.value(QStringLiteral("mainwindow/geometry")).toByteArray()); if (!Settings::Instance().IsBatchModeEnabled()) + { + SetQWidgetWindowDecorations(this); show(); + } InitControllers(); ConnectHotkeys(); @@ -320,6 +323,12 @@ MainWindow::MainWindow(std::unique_ptr<BootParameters> boot_parameters, } Host::GetInstance()->SetMainWindowHandle(reinterpret_cast<void*>(winId())); + + if (m_pending_boot != nullptr) + { + StartGame(std::move(m_pending_boot)); + m_pending_boot.reset(); + } } MainWindow::~MainWindow() @@ -2073,19 +2082,3 @@ void MainWindow::ShowRiivolutionBootWidget(const UICommon::GameFile& game) AddRiivolutionPatches(boot_params.get(), std::move(w.GetPatches())); StartGame(std::move(boot_params)); } - -void MainWindow::Show() -{ - if (!Settings::Instance().IsBatchModeEnabled()) - { - SetQWidgetWindowDecorations(this); - QWidget::show(); - } - - // If the booting of a game was requested on start up, do that now - if (m_pending_boot != nullptr) - { - StartGame(std::move(m_pending_boot)); - m_pending_boot.reset(); - } -} |
