From d61f12cb4ee51a9a80371f9df10ce217924f4fbd Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Mon, 6 Jan 2020 14:08:00 +1000 Subject: [PATCH] Qt: Set focus to display window when starting --- src/duckstation-qt/mainwindow.cpp | 5 +++-- src/duckstation-qt/mainwindow.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/duckstation-qt/mainwindow.cpp b/src/duckstation-qt/mainwindow.cpp index 2d8d4a249..8a5976129 100644 --- a/src/duckstation-qt/mainwindow.cpp +++ b/src/duckstation-qt/mainwindow.cpp @@ -108,8 +108,8 @@ void MainWindow::setupAdditionalUi() m_game_list_widget->initialize(m_host_interface); m_ui.mainContainer->insertWidget(0, m_game_list_widget); - QWidget* display_widget = m_host_interface->createDisplayWidget(m_ui.mainContainer); - m_ui.mainContainer->insertWidget(1, display_widget); + m_display_widget = m_host_interface->createDisplayWidget(m_ui.mainContainer); + m_ui.mainContainer->insertWidget(1, m_display_widget); m_ui.mainContainer->setCurrentIndex(0); } @@ -140,6 +140,7 @@ void MainWindow::switchToGameListView() void MainWindow::switchToEmulationView() { m_ui.mainContainer->setCurrentIndex(1); + m_display_widget->setFocus(); } void MainWindow::connectSignals() diff --git a/src/duckstation-qt/mainwindow.h b/src/duckstation-qt/mainwindow.h index c0c7dd8d2..06b17ab38 100644 --- a/src/duckstation-qt/mainwindow.h +++ b/src/duckstation-qt/mainwindow.h @@ -50,6 +50,7 @@ private: std::unique_ptr m_game_list; GameListWidget* m_game_list_widget = nullptr; + QWidget* m_display_widget = nullptr; SettingsDialog* m_settings_dialog = nullptr;