From 27c91dbd36a5afa0c01ff3f4063e1f82c40b8089 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 13 Sep 2022 17:43:10 +0200 Subject: [PATCH] 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 --- src/plugins/platforms/cocoa/qcocoawindow.mm | 22 ++++----------------- 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index ff8a15f0d6..07fee0a861 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -1078,28 +1078,14 @@ void QCocoaWindow::setMask(const QRegion ®ion) } } -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