macOS: don't let windows that are transparent for input become key window
Such windows are typically used as mostly transparent overlays on top of other windows underneath. Letting such an overlay become the key window breaks cursor updates and focus handling. Pick-to: 6.0 6.1 5.15 Fixes: QTBUG-83632 Change-Id: I192d419a5bdb8dfa0e9223e9fbbd7876c62fe743 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
parent
3fa50b7b41
commit
24b07b2b2d
@ -1857,7 +1857,7 @@ bool QCocoaWindow::shouldRefuseKeyWindowAndFirstResponder()
|
||||
// This function speaks up if there's any reason
|
||||
// to refuse key window or first responder state.
|
||||
|
||||
if (window()->flags() & Qt::WindowDoesNotAcceptFocus)
|
||||
if (window()->flags() & (Qt::WindowDoesNotAcceptFocus | Qt::WindowTransparentForInput))
|
||||
return true;
|
||||
|
||||
if (m_inSetVisible) {
|
||||
|
@ -266,7 +266,8 @@ Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet")
|
||||
|
||||
- (BOOL)canBecomeFirstResponder
|
||||
{
|
||||
return !(self.platformWindow->window()->flags() & Qt::WindowDoesNotAcceptFocus);
|
||||
return !(self.platformWindow->window()->flags() & (Qt::WindowDoesNotAcceptFocus
|
||||
| Qt::WindowTransparentForInput));
|
||||
}
|
||||
|
||||
- (BOOL)becomeFirstResponder
|
||||
|
Loading…
Reference in New Issue
Block a user