Mouse capture is no longer possible when the emulator is paused, fixes #3799.

This commit is contained in:
OBattler
2023-11-04 06:41:57 +01:00
parent f8127ad421
commit 06c7567495
2 changed files with 5 additions and 2 deletions

View File

@@ -144,7 +144,10 @@ int ignoreNextMouseEvent = 1;
void void
RendererStack::mouseReleaseEvent(QMouseEvent *event) RendererStack::mouseReleaseEvent(QMouseEvent *event)
{ {
if (this->geometry().contains(event->pos()) && (event->button() == Qt::LeftButton) && !mouse_capture && (isMouseDown & 1) && (kbd_req_capture || (mouse_get_buttons() != 0)) && (mouse_input_mode == 0)) { if (!dopause && this->geometry().contains(event->pos()) &&
(event->button() == Qt::LeftButton) && !mouse_capture &&
(isMouseDown & 1) && (kbd_req_capture || (mouse_get_buttons() != 0)) &&
(mouse_input_mode == 0)) {
plat_mouse_capture(1); plat_mouse_capture(1);
this->setCursor(Qt::BlankCursor); this->setCursor(Qt::BlankCursor);
if (!ignoreNextMouseEvent) if (!ignoreNextMouseEvent)

View File

@@ -627,7 +627,7 @@ sdl_main()
case SDL_MOUSEBUTTONDOWN: case SDL_MOUSEBUTTONDOWN:
case SDL_MOUSEBUTTONUP: case SDL_MOUSEBUTTONUP:
{ {
if ((event.button.button == SDL_BUTTON_LEFT) if (!dopause && (event.button.button == SDL_BUTTON_LEFT)
&& !(mouse_capture || video_fullscreen) && !(mouse_capture || video_fullscreen)
&& event.button.state == SDL_RELEASED && event.button.state == SDL_RELEASED
&& mouse_inside) { && mouse_inside) {