From a9d3a0b47c60fff0544de56fce73557002f941e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 17 Jun 2024 16:00:50 +0200 Subject: [PATCH] macOS: Don't use full screen geometry for popups MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The fullscren geometry when an application is in full screen includes the area above the menu bar. Unfortunately, when clicking on areas of a Qt popup that overlays the menu bare area we get a callback for NSMenuDidBeginTrackingNotification, and as a result we close all popups. As macOS for some reason treats the menu bar area as special and tracks clicks there even if another window is on top, we should not put our popups there. This also matches the geometry of windows shown full screen, which does not overlap the menu bar area either when using the native APIs to make a window fullscreen (which we do). This change does not affect the original issue (QTBUG-39403), as the QScreen::availableGeometry() nowadays does not exclude the area of the Dock when in fullscreen mode. Pick-to: 6.7 6.5 Task-number: QTBUG-39403 Fixes: QTBUG-123298 Change-Id: I5890d7fc7a9b95a98b8fd2b9ce58ed9789e7f36e Reviewed-by: Morten Johan Sørvig Reviewed-by: Volker Hilsheimer (cherry picked from commit 7f63b0fabb3f2ae67596cc061f202ddd77ddf56b) Reviewed-by: Qt Cherry-pick Bot --- src/plugins/platforms/cocoa/qcocoatheme.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/cocoa/qcocoatheme.mm b/src/plugins/platforms/cocoa/qcocoatheme.mm index 1623b12be63..6d15e8e5d2c 100644 --- a/src/plugins/platforms/cocoa/qcocoatheme.mm +++ b/src/plugins/platforms/cocoa/qcocoatheme.mm @@ -453,7 +453,7 @@ QVariant QCocoaTheme::themeHint(ThemeHint hint) const case QPlatformTheme::SpellCheckUnderlineStyle: return QVariant(int(QTextCharFormat::DotLine)); case QPlatformTheme::UseFullScreenForPopupMenu: - return QVariant(bool([[NSApplication sharedApplication] presentationOptions] & NSApplicationPresentationFullScreen)); + return false; case QPlatformTheme::InteractiveResizeAcrossScreens: return !NSScreen.screensHaveSeparateSpaces; case QPlatformTheme::ShowDirectoriesFirst: