diff --git a/src/device/keyboard.c b/src/device/keyboard.c index 7806418dd..e77a5fc1d 100644 --- a/src/device/keyboard.c +++ b/src/device/keyboard.c @@ -372,7 +372,7 @@ keyboard_input(int down, uint16_t scan) /* kbc_at_log("Received scan code: %03X (%s)\n", scan & 0x1ff, down ? "down" : "up"); */ recv_key_ui[scan & 0x1ff] = down; - if (mouse_capture || !kbd_req_capture || video_fullscreen) { + if (mouse_capture || !kbd_req_capture || (video_fullscreen && !fullscreen_ui_visible)) { recv_key[scan & 0x1ff] = down; key_process(scan & 0x1ff, down); } diff --git a/src/device/mouse_bus.c b/src/device/mouse_bus.c index cd54f981a..52f7154a0 100644 --- a/src/device/mouse_bus.c +++ b/src/device/mouse_bus.c @@ -481,7 +481,7 @@ bm_poll(void *priv) int xor; int b = mouse_get_buttons_ex(); - if (!mouse_capture && !video_fullscreen) + if (!mouse_capture && !(video_fullscreen && !fullscreen_ui_visible)) return 1; if (!(dev->flags & FLAG_ENABLED)) @@ -543,7 +543,7 @@ bm_update_data(mouse_t *dev) int xor; /* If the counters are not frozen, update them. */ - if ((mouse_capture || video_fullscreen) && !(dev->flags & FLAG_HOLD)) { + if ((mouse_capture || (video_fullscreen && !fullscreen_ui_visible)) && !(dev->flags & FLAG_HOLD)) { /* Update the deltas and the delays. */ mouse_subtract_coords(&delta_x, &delta_y, NULL, NULL, -128, 127, 0, 0); diff --git a/src/device/mouse_ps2.c b/src/device/mouse_ps2.c index 80d9f3876..9034d9322 100644 --- a/src/device/mouse_ps2.c +++ b/src/device/mouse_ps2.c @@ -332,7 +332,7 @@ ps2_poll(void *priv) atkbc_dev_t *dev = (atkbc_dev_t *) priv; int packet_size = (dev->flags & FLAG_INTMODE) ? 4 : 3; - int cond = (mouse_capture || video_fullscreen) && mouse_scan && (dev->mode == MODE_STREAM) && + int cond = (mouse_capture || (video_fullscreen && !fullscreen_ui_visible)) && mouse_scan && (dev->mode == MODE_STREAM) && mouse_state_changed() && (kbc_at_dev_queue_pos(dev, 1) < (FIFO_SIZE - packet_size)); if (cond) diff --git a/src/include/86box/plat.h b/src/include/86box/plat.h index e18aa707b..7835fe3a2 100644 --- a/src/include/86box/plat.h +++ b/src/include/86box/plat.h @@ -132,6 +132,7 @@ extern int update_icons; extern int kbd_req_capture; extern int hide_status_bar; extern int hide_tool_bar; +extern int fullscreen_ui_visible; /* System-related functions. */ extern FILE *plat_fopen(const char *path, const char *mode); diff --git a/src/qt/qt_mainwindow.cpp b/src/qt/qt_mainwindow.cpp index d5c3f26c4..44bf1269e 100644 --- a/src/qt/qt_mainwindow.cpp +++ b/src/qt/qt_mainwindow.cpp @@ -67,6 +67,8 @@ extern int qt_nvr_save(void); extern bool cpu_thread_running; }; +int fullscreen_ui_visible = 0; + #include #include #include @@ -1297,7 +1299,7 @@ MainWindow::processKeyboardInput(bool down, uint32_t keycode) case 0x10b: /* Microsoft scroll up normal */ case 0x180 ... 0x1ff: /* E0 break codes (including Microsoft scroll down normal) */ /* This key uses a break code as make. Send it manually, only on press. */ - if (down && (mouse_capture || !kbd_req_capture || video_fullscreen)) { + if (down && (mouse_capture || !kbd_req_capture || (video_fullscreen && !fullscreen_ui_visible))) { if (keycode & 0x100) keyboard_send(0xe0); keyboard_send(keycode & 0xff); @@ -1464,7 +1466,7 @@ MainWindow::on_actionFullscreen_triggered() if (!hide_tool_bar) ui->toolBar->show(); video_fullscreen = 0; - fullscreen_ui_visible = false; + fullscreen_ui_visible = 0; if (vid_resize != 1) { emit resizeContents(vid_resize == 2 ? fixed_size_x : monitors[0].mon_scrnsz_x, vid_resize == 2 ? fixed_size_y : monitors[0].mon_scrnsz_y); } diff --git a/src/qt/qt_mainwindow.hpp b/src/qt/qt_mainwindow.hpp index 9bec1a049..1a1cf4f20 100644 --- a/src/qt/qt_mainwindow.hpp +++ b/src/qt/qt_mainwindow.hpp @@ -198,9 +198,6 @@ private: /* Reload the renderers after closing renderer options dialog. */ bool reload_renderers = false; - /* Fullscreen UI visibility state */ - bool fullscreen_ui_visible = false; - /* Mouse capture state before showing fullscreen UI */ bool mouse_was_captured = false;