diff options
-rw-r--r-- | src/gui/kernel/qwindow.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index bcd8351619..a19df4da0f 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -218,6 +218,12 @@ QWindow::~QWindow() QGuiApplicationPrivate::window_list.removeAll(this); 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. + if (QGuiApplicationPrivate::focus_window == this) + QGuiApplicationPrivate::focus_window = 0; } void QWindowPrivate::init(QScreen *targetScreen) |