From e4a4549e3f99d329c2c216e5e4fee5fd42045299 Mon Sep 17 00:00:00 2001 From: cold-brewed Date: Sat, 29 Oct 2022 09:09:30 -0400 Subject: [PATCH 1/3] qt: Rework ui pause update into a slot for thread safety --- src/qt/qt_mainwindow.cpp | 6 +++--- src/qt/qt_mainwindow.hpp | 2 +- src/qt/qt_platform.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) 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) From 963d186e2e474b27c1fabd33a662f35122aa3c01 Mon Sep 17 00:00:00 2001 From: javi-s Date: Sat, 29 Oct 2022 23:28:06 +0200 Subject: [PATCH 2/3] Fix NVR size for Olivetti M24 --- src/machine/machine_table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index e4c437016..c7d2be4ec 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -1999,7 +1999,7 @@ const machine_t machines[] = { .max = 640, .step = 128 }, - .nvrmask = 0, + .nvrmask = 15, .kbc = KBC_OLIVETTI_XT, .kbc_p1 = 0xff00, .gpio = 0xffffffff, From 99b72cd76a8ddc56ff5ec9af11a3f95cb58aa573 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Sun, 30 Oct 2022 19:31:32 +0600 Subject: [PATCH 3/3] qt: Add missing Windows/Menu key X11-to-Set1 mappings --- src/qt/qt_mainwindow.cpp | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/src/qt/qt_mainwindow.cpp b/src/qt/qt_mainwindow.cpp index e97864a3a..5b23a859f 100644 --- a/src/qt/qt_mainwindow.cpp +++ b/src/qt/qt_mainwindow.cpp @@ -1005,17 +1005,17 @@ std::array x11_to_xt_2 0x51, 0x52, 0x53, - 0x54, + 0x138, 0x55, - 0x56, + 0x35, 0x57, 0x58, - 0, - 0, - 0, - 0, - 0, - 0, + 0x56, + 0x70, + 0x7B, + 0x7D, + 0x2B, + 0x7E, 0, 0x11C, 0x11D, @@ -1032,7 +1032,23 @@ std::array x11_to_xt_2 0x150, 0x151, 0x152, - 0x153 + 0x153, + 0, + 0, /* Mute */ + 0, /* Volume Down */ + 0, /* Volume Up */ + 0, /* Power Off */ + 0, + 0, + 0, + 0, + 0, + 0x70, + 0x7B, + 0x73, + 0x15B, + 0x15C, + 0x15D }; std::array x11_to_xt_vnc @@ -1627,8 +1643,6 @@ void MainWindow::keyPressEvent(QKeyEvent* event) keyboard_input(1, 0x1D); keyboard_input(1, 0x45); } - } else if (event->key() == Qt::Key_Super_L || event->key() == Qt::Key_Super_R) { - keyboard_input(1, event->key() == Qt::Key_Super_L ? 0x15B : 0x15C); } else #ifdef Q_OS_MACOS processMacKeyboardInput(true, event); @@ -1672,9 +1686,6 @@ void MainWindow::keyReleaseEvent(QKeyEvent* event) if (!send_keyboard_input) return; - if (event->key() == Qt::Key_Super_L || event->key() == Qt::Key_Super_R) { - keyboard_input(0, event->key() == Qt::Key_Super_L ? 0x15B : 0x15C); - } else #ifdef Q_OS_MACOS processMacKeyboardInput(false, event); #else