From 1289e045b9431b3dfe4ea759f0301392672d04a5 Mon Sep 17 00:00:00 2001 From: Davide Pesavento Date: Tue, 15 Jul 2025 23:31:35 -0400 Subject: [PATCH] Qt: Make "Fullscreen" toolbar button and menu item checkable --- src/duckstation-qt/mainwindow.cpp | 12 ++++-------- src/duckstation-qt/mainwindow.h | 2 +- src/duckstation-qt/mainwindow.ui | 3 +++ 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/duckstation-qt/mainwindow.cpp b/src/duckstation-qt/mainwindow.cpp index 608f47360..0ad82314d 100644 --- a/src/duckstation-qt/mainwindow.cpp +++ b/src/duckstation-qt/mainwindow.cpp @@ -401,7 +401,7 @@ void MainWindow::createDisplayWidget(bool fullscreen, bool render_to_main, bool m_ui.actionViewSystemDisplay->setChecked(true); } - updateDisplayRelatedActions(true, render_to_main, fullscreen); + updateDisplayRelatedActions(true, fullscreen); updateShortcutActions(false); updateDisplayWidgetCursor(); @@ -483,7 +483,7 @@ void MainWindow::destroyDisplayWidget(bool show_game_list) m_exclusive_fullscreen_requested = false; - updateDisplayRelatedActions(false, false, false); + updateDisplayRelatedActions(false, false); updateShortcutActions(false); } @@ -497,17 +497,13 @@ void MainWindow::updateDisplayWidgetCursor() m_display_widget->updateCursor(s_system_valid && !s_system_paused && shouldHideMouseCursor()); } -void MainWindow::updateDisplayRelatedActions(bool has_surface, bool render_to_main, bool fullscreen) +void MainWindow::updateDisplayRelatedActions(bool has_surface, bool fullscreen) { // rendering to main, or switched to gamelist/grid m_ui.actionViewSystemDisplay->setEnabled(wantsDisplayWidget() && QtHost::CanRenderToMainWindow()); m_ui.menuWindowSize->setEnabled(has_surface && !fullscreen); m_ui.actionFullscreen->setEnabled(has_surface); - - { - QSignalBlocker blocker(m_ui.actionFullscreen); - m_ui.actionFullscreen->setChecked(fullscreen); - } + m_ui.actionFullscreen->setChecked(fullscreen); } void MainWindow::focusDisplayWidget() diff --git a/src/duckstation-qt/mainwindow.h b/src/duckstation-qt/mainwindow.h index 7debe1337..7d5ef2acc 100644 --- a/src/duckstation-qt/mainwindow.h +++ b/src/duckstation-qt/mainwindow.h @@ -271,7 +271,7 @@ private: void createDisplayWidget(bool fullscreen, bool render_to_main, bool use_main_window_pos); void destroyDisplayWidget(bool show_game_list); void updateDisplayWidgetCursor(); - void updateDisplayRelatedActions(bool has_surface, bool render_to_main, bool fullscreen); + void updateDisplayRelatedActions(bool has_surface, bool fullscreen); void doSettings(const char* category = nullptr); void openGamePropertiesForCurrentGame(const char* category = nullptr); diff --git a/src/duckstation-qt/mainwindow.ui b/src/duckstation-qt/mainwindow.ui index b092b01da..93cd7129b 100644 --- a/src/duckstation-qt/mainwindow.ui +++ b/src/duckstation-qt/mainwindow.ui @@ -421,6 +421,9 @@ + + true +