diff --git a/src/qt/qt_mainwindow.cpp b/src/qt/qt_mainwindow.cpp index e97864a3a..c6206de96 100644 --- a/src/qt/qt_mainwindow.cpp +++ b/src/qt/qt_mainwindow.cpp @@ -2052,9 +2052,9 @@ void MainWindow::setSendKeyboardInput(bool enabled) send_keyboard_input = enabled; } -void MainWindow::setUiPauseState(bool paused) { - auto pause_icon = paused ? QIcon(":/menuicons/win/icons/run.ico") : QIcon(":/menuicons/win/icons/pause.ico"); - auto tooltip_text = paused ? QString(tr("Resume execution")) : QString(tr("Pause execution")); +void MainWindow::updateUiPauseState() { + auto pause_icon = dopause ? QIcon(":/menuicons/win/icons/run.ico") : QIcon(":/menuicons/win/icons/pause.ico"); + auto tooltip_text = dopause ? QString(tr("Resume execution")) : QString(tr("Pause execution")); ui->actionPause->setIcon(pause_icon); ui->actionPause->setToolTip(tooltip_text); } diff --git a/src/qt/qt_mainwindow.hpp b/src/qt/qt_mainwindow.hpp index a91fd1f57..ef70a0826 100644 --- a/src/qt/qt_mainwindow.hpp +++ b/src/qt/qt_mainwindow.hpp @@ -33,7 +33,6 @@ public: void blitToWidget(int x, int y, int w, int h, int monitor_index); QSize getRenderWidgetSize(); void setSendKeyboardInput(bool enabled); - void setUiPauseState(bool paused); std::array, 8> renderers; signals: @@ -65,6 +64,7 @@ public slots: void togglePause(); void initRendererMonitorSlot(int monitor_index); void destroyRendererMonitorSlot(int monitor_index); + void updateUiPauseState(); private slots: void on_actionFullscreen_triggered(); void on_actionSettings_triggered(); diff --git a/src/qt/qt_platform.cpp b/src/qt/qt_platform.cpp index 4163b0ce5..bcf51d70d 100644 --- a/src/qt/qt_platform.cpp +++ b/src/qt/qt_platform.cpp @@ -366,7 +366,7 @@ plat_pause(int p) ui_window_title(oldtitle); } discord_update_activity(dopause); - main_window->setUiPauseState(p); + QTimer::singleShot(0, main_window, &MainWindow::updateUiPauseState); #ifdef Q_OS_WINDOWS if (source_hwnd)