Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[qtgui] Fix crash when a focused window's surface is destroyed. Contr…
…ibutes to JB#40880

Ensure full focus out and in are processed when transferring focus to the
parent window, otherwise the focusObjectChanged() signal of the window
whose window was destroyed will remain connected to
QGuiApplicationPrivate::_q_setFocusObject() and that can result in
an object not belonging to the active window (assuming there is one)
getting focus.
  • Loading branch information
denexter committed Jun 5, 2018
1 parent 9a63b8d commit 9a8473b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gui/kernel/qwindow.cpp
Expand Up @@ -1808,7 +1808,7 @@ void QWindowPrivate::destroy()
}

if (QGuiApplicationPrivate::focus_window == q)
QGuiApplicationPrivate::focus_window = q->parent();
QWindowSystemInterface::handleWindowActivated(q->parent());
if (QGuiApplicationPrivate::currentMouseWindow == q)
QGuiApplicationPrivate::currentMouseWindow = q->parent();
if (QGuiApplicationPrivate::currentMousePressWindow == q)
Expand Down

0 comments on commit 9a8473b

Please sign in to comment.