summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Liam2022-12-21 19:27:11 -0500
committerGravatar Liam2022-12-21 19:27:11 -0500
commitae6015a69b211a98f9ef97d73b5c301c359ca35f (patch)
treea3404e7ab91e203a4f390dd6367160e6fee775df
parentqt: continue event loop during game close (diff)
downloadyuzu-ae6015a69b211a98f9ef97d73b5c301c359ca35f.tar.gz
yuzu-ae6015a69b211a98f9ef97d73b5c301c359ca35f.tar.xz
yuzu-ae6015a69b211a98f9ef97d73b5c301c359ca35f.zip
qt: use main window as close overlay parent
Diffstat (limited to '')
-rw-r--r--src/yuzu/main.cpp5
-rw-r--r--src/yuzu/util/overlay_dialog.cpp3
2 files changed, 4 insertions, 4 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 66fdbcfed..c67fb997a 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -1815,9 +1815,8 @@ void GMainWindow::OnShutdownBegin() {
1815} 1815}
1816 1816
1817void GMainWindow::OnShutdownBeginDialog() { 1817void GMainWindow::OnShutdownBeginDialog() {
1818 shutdown_dialog = 1818 shutdown_dialog = new OverlayDialog(this, *system, QString{}, tr("Closing software..."),
1819 new OverlayDialog(render_window, *system, QString{}, tr("Closing software..."), QString{}, 1819 QString{}, QString{}, Qt::AlignHCenter | Qt::AlignVCenter);
1820 QString{}, Qt::AlignHCenter | Qt::AlignVCenter);
1821 shutdown_dialog->open(); 1820 shutdown_dialog->open();
1822} 1821}
1823 1822
diff --git a/src/yuzu/util/overlay_dialog.cpp b/src/yuzu/util/overlay_dialog.cpp
index 25fa789ac..796f5bf41 100644
--- a/src/yuzu/util/overlay_dialog.cpp
+++ b/src/yuzu/util/overlay_dialog.cpp
@@ -3,6 +3,7 @@
3 3
4#include <QKeyEvent> 4#include <QKeyEvent>
5#include <QScreen> 5#include <QScreen>
6#include <QWindow>
6 7
7#include "core/core.h" 8#include "core/core.h"
8#include "core/hid/hid_types.h" 9#include "core/hid/hid_types.h"
@@ -162,7 +163,7 @@ void OverlayDialog::MoveAndResizeWindow() {
162 const auto height = static_cast<float>(parentWidget()->height()); 163 const auto height = static_cast<float>(parentWidget()->height());
163 164
164 // High DPI 165 // High DPI
165 const float dpi_scale = qApp->screenAt(pos)->logicalDotsPerInch() / 96.0f; 166 const float dpi_scale = parentWidget()->windowHandle()->screen()->logicalDotsPerInch() / 96.0f;
166 167
167 const auto title_text_font_size = BASE_TITLE_FONT_SIZE * (height / BASE_HEIGHT) / dpi_scale; 168 const auto title_text_font_size = BASE_TITLE_FONT_SIZE * (height / BASE_HEIGHT) / dpi_scale;
168 const auto body_text_font_size = 169 const auto body_text_font_size =