diff options
-rw-r--r-- | src/gui/kernel/qwindow.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index 83c776a485..15fcceb9c1 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -223,11 +223,15 @@ QWindow::~QWindow() if (!QGuiApplicationPrivate::is_app_closing) QGuiApplicationPrivate::instance()->modalWindowList.removeOne(this); - // focus_window is normally cleared in destroy(), but the window may in - // some cases end up becoming the focus window again. Clear it again - // here as a workaround. See QTBUG-75326. + // thse are normally cleared in destroy(), but the window may in + // some cases end up becoming the focus window again, or receive an enter + // event. Clear it again here as a workaround. See QTBUG-75326. if (QGuiApplicationPrivate::focus_window == this) QGuiApplicationPrivate::focus_window = nullptr; + if (QGuiApplicationPrivate::currentMouseWindow == this) + QGuiApplicationPrivate::currentMouseWindow = nullptr; + if (QGuiApplicationPrivate::currentMousePressWindow == this) + QGuiApplicationPrivate::currentMousePressWindow = nullptr; } void QWindowPrivate::init(QScreen *targetScreen) |