macOS: Return false from set(Keyboard/Mouse)GrabEnabled

[ChangeLog][macOS] QWindow::setKeyboardGrabEnabled() and
QWindow::setMouseGrabEnabled() now returns false, as the feature is
not implemented on macOS yet. If you were relying on these functions
to make the window key (activate it), please use
QWindow::requestActivate() instead.

Task-number: QTBUG-106597
Change-Id: I86d7d806080aae98c9aec5287adfcc8cb70d372a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
bb10
Tor Arne Vestbø 2022-09-13 17:43:10 +02:00
parent 8c7bf85192
commit 27c91dbd36
1 changed files with 4 additions and 18 deletions

View File

@ -1078,28 +1078,14 @@ void QCocoaWindow::setMask(const QRegion &region)
}
}
bool QCocoaWindow::setKeyboardGrabEnabled(bool grab)
bool QCocoaWindow::setKeyboardGrabEnabled(bool)
{
qCDebug(lcQpaWindow) << "QCocoaWindow::setKeyboardGrabEnabled" << window() << grab;
if (!isContentView())
return false;
if (grab && ![m_view.window isKeyWindow])
[m_view.window makeKeyWindow];
return true;
return false; // FIXME (QTBUG-106597)
}
bool QCocoaWindow::setMouseGrabEnabled(bool grab)
bool QCocoaWindow::setMouseGrabEnabled(bool)
{
qCDebug(lcQpaWindow) << "QCocoaWindow::setMouseGrabEnabled" << window() << grab;
if (!isContentView())
return false;
if (grab && ![m_view.window isKeyWindow])
[m_view.window makeKeyWindow];
return true;
return false; // FIXME (QTBUG-106597)
}
WId QCocoaWindow::winId() const