QCocoaWindow - do not call resignKeyWindow
QCocoaWindow::setMouseGrabEnabled/setKeyboardGrabEnabled calls resignKeyWindow. According to Apple's docs, we should _never_ call this function (it's done by Cocoa automatically). Calling this function leaves a window in weird state where it can not become key again until you explicitly make another window key first. Task-number: QTBUG-53050 Change-Id: I7a887659df8df11880328ffa2adc07c4a3af63e6 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This commit is contained in:
parent
ce37467acf
commit
ab3a8443fa
@ -1135,8 +1135,7 @@ bool QCocoaWindow::setKeyboardGrabEnabled(bool grab)
|
|||||||
|
|
||||||
if (grab && ![m_nsWindow isKeyWindow])
|
if (grab && ![m_nsWindow isKeyWindow])
|
||||||
[m_nsWindow makeKeyWindow];
|
[m_nsWindow makeKeyWindow];
|
||||||
else if (!grab && [m_nsWindow isKeyWindow])
|
|
||||||
[m_nsWindow resignKeyWindow];
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1147,8 +1146,7 @@ bool QCocoaWindow::setMouseGrabEnabled(bool grab)
|
|||||||
|
|
||||||
if (grab && ![m_nsWindow isKeyWindow])
|
if (grab && ![m_nsWindow isKeyWindow])
|
||||||
[m_nsWindow makeKeyWindow];
|
[m_nsWindow makeKeyWindow];
|
||||||
else if (!grab && [m_nsWindow isKeyWindow])
|
|
||||||
[m_nsWindow resignKeyWindow];
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user