Skip to content

Commit

Permalink
[qtgui] Fix crash when a focused window's surface is destroyed. Contr…
Browse files Browse the repository at this point in the history
…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 May 18, 2018
1 parent 3f59677 commit ad9eb80
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gui/kernel/qwindow.cpp
Expand Up @@ -1651,7 +1651,7 @@ void QWindow::destroy()
}

if (QGuiApplicationPrivate::focus_window == this)
QGuiApplicationPrivate::focus_window = parent();
QWindowSystemInterface::handleWindowActivated(parent());
if (QGuiApplicationPrivate::currentMouseWindow == this)
QGuiApplicationPrivate::currentMouseWindow = parent();
if (QGuiApplicationPrivate::currentMousePressWindow == this)
Expand Down

0 comments on commit ad9eb80

Please sign in to comment.