mirror of
https://git.h3cjp.net/H3cJP/yuzu.git
synced 2024-12-15 23:35:38 +00:00
Allow focus only when in popout mode
Only allow manually setting focus to the rendering widget when in Single Window mode. Apply this behavior to when changing the mode while an app is running.
This commit is contained in:
parent
9d90b26020
commit
ba4ca041f4
|
@ -123,9 +123,6 @@ GRenderWindow::GRenderWindow(QWidget* parent) : QWidget(parent), emu_thread(this
|
||||||
std::string window_title = Common::StringFromFormat("Citra | %s-%s", Common::g_scm_branch, Common::g_scm_desc);
|
std::string window_title = Common::StringFromFormat("Citra | %s-%s", Common::g_scm_branch, Common::g_scm_desc);
|
||||||
setWindowTitle(QString::fromStdString(window_title));
|
setWindowTitle(QString::fromStdString(window_title));
|
||||||
|
|
||||||
// Allow manually setting focus to the widget.
|
|
||||||
setFocusPolicy(Qt::ClickFocus);
|
|
||||||
|
|
||||||
keyboard_id = KeyMap::NewDeviceId();
|
keyboard_id = KeyMap::NewDeviceId();
|
||||||
ReloadSetKeymaps();
|
ReloadSetKeymaps();
|
||||||
|
|
||||||
|
|
|
@ -170,7 +170,13 @@ void GMainWindow::BootGame(std::string filename)
|
||||||
render_window->GetEmuThread().start();
|
render_window->GetEmuThread().start();
|
||||||
|
|
||||||
render_window->show();
|
render_window->show();
|
||||||
render_window->setFocus();
|
|
||||||
|
// Allow manually setting focus to the render widget if not using popout mode.
|
||||||
|
if (!ui.action_Popout_Window_Mode->isChecked()) {
|
||||||
|
render_window->setFocusPolicy(Qt::ClickFocus);
|
||||||
|
render_window->setFocus();
|
||||||
|
}
|
||||||
|
|
||||||
OnStartGame();
|
OnStartGame();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -231,12 +237,15 @@ void GMainWindow::ToggleWindowMode()
|
||||||
render_window->setParent(nullptr);
|
render_window->setParent(nullptr);
|
||||||
render_window->setVisible(true);
|
render_window->setVisible(true);
|
||||||
render_window->RestoreGeometry();
|
render_window->RestoreGeometry();
|
||||||
|
render_window->setFocusPolicy(Qt::NoFocus);
|
||||||
}
|
}
|
||||||
else if (!enable && render_window->parent() == nullptr)
|
else if (!enable && render_window->parent() == nullptr)
|
||||||
{
|
{
|
||||||
render_window->BackupGeometry();
|
render_window->BackupGeometry();
|
||||||
ui.horizontalLayout->addWidget(render_window);
|
ui.horizontalLayout->addWidget(render_window);
|
||||||
render_window->setVisible(true);
|
render_window->setVisible(true);
|
||||||
|
render_window->setFocusPolicy(Qt::ClickFocus);
|
||||||
|
render_window->setFocus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue