From dd2fb22e413f4a6f992341c1b6235bbfd83ccae1 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Sat, 5 Feb 2022 02:23:55 +0600 Subject: [PATCH] Revert "Fix for capture on closing/double-clicking at selection on file dialogs" This reverts commit 54853c2d624993a3f41934364d19c5c9fb628529. --- src/qt/qt_rendererstack.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/qt/qt_rendererstack.cpp b/src/qt/qt_rendererstack.cpp index db19e6a7d..d11b4a0b5 100644 --- a/src/qt/qt_rendererstack.cpp +++ b/src/qt/qt_rendererstack.cpp @@ -86,33 +86,29 @@ void RendererStack::mousePoll() #endif } -static int ignoreNextMouseEvent = 1, isButtonDown = 0; +int ignoreNextMouseEvent = 1; void RendererStack::mouseReleaseEvent(QMouseEvent *event) { - if (this->geometry().contains(event->pos()) && event->button() == Qt::LeftButton && !mouse_capture && (isButtonDown & 1)) + if (this->geometry().contains(event->pos()) && event->button() == Qt::LeftButton && !mouse_capture) { plat_mouse_capture(1); this->setCursor(Qt::BlankCursor); if (!ignoreNextMouseEvent) ignoreNextMouseEvent++; // Avoid jumping cursor when moved. - isButtonDown &= ~1; return; } if (mouse_capture && event->button() == Qt::MiddleButton && mouse_get_buttons() < 3) { plat_mouse_capture(0); this->setCursor(Qt::ArrowCursor); - isButtonDown &= ~1; return; } if (mouse_capture) { mousedata.mousebuttons &= ~event->button(); } - isButtonDown &= ~1; } void RendererStack::mousePressEvent(QMouseEvent *event) { - isButtonDown |= 1; if (mouse_capture) { mousedata.mousebuttons |= event->button();