From ea40eb0994a4201ebe1bf5df958de116fcd73c8c Mon Sep 17 00:00:00 2001 From: James Rowe Date: Thu, 28 Nov 2019 20:35:50 -0700 Subject: [PATCH] Use the proper parent window Fixes an issue where the touch point is incorrect in OpenGLWindow when the render target is initialized for the first time with single window mode disabled. --- src/citra_qt/bootmanager.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/citra_qt/bootmanager.cpp b/src/citra_qt/bootmanager.cpp index 92c450f78d..595e6d1521 100644 --- a/src/citra_qt/bootmanager.cpp +++ b/src/citra_qt/bootmanager.cpp @@ -354,8 +354,9 @@ void GRenderWindow::InitRenderTarget() { delete child_widget; } - child_window = new OpenGLWindow(QWidget::window()->windowHandle(), this, - QOpenGLContext::globalShareContext()); + GMainWindow* parent = GetMainWindow(); + QWindow* parent_win_handle = parent ? parent->windowHandle() : nullptr; + child_window = new OpenGLWindow(parent_win_handle, this, QOpenGLContext::globalShareContext()); child_window->create(); child_widget = createWindowContainer(child_window, this); child_widget->resize(Core::kScreenTopWidth, Core::kScreenTopHeight + Core::kScreenBottomHeight);