diff --git a/src/gui/kernel/qplatformtheme.cpp b/src/gui/kernel/qplatformtheme.cpp index 5de1c98127..34f7307cd7 100644 --- a/src/gui/kernel/qplatformtheme.cpp +++ b/src/gui/kernel/qplatformtheme.cpp @@ -163,6 +163,10 @@ QT_BEGIN_NAMESPACE \value ShowShortcutsInContextMenus (bool) Whether to display shortcut key sequences in context menus. + \value InteractiveResizeAcrossScreens (bool) Whether using the whole virtual geometry of all the screens + as basis for the resize. + This enum value has been added in Qt 6.2. + \sa themeHint(), QStyle::pixelMetric() */ @@ -563,6 +567,8 @@ QVariant QPlatformTheme::defaultThemeHint(ThemeHint hint) } case MouseQuickSelectionThreshold: return QVariant(10); + case InteractiveResizeAcrossScreens: + return true; } return QVariant(); } diff --git a/src/gui/kernel/qplatformtheme.h b/src/gui/kernel/qplatformtheme.h index d736948969..0b6c0254f0 100644 --- a/src/gui/kernel/qplatformtheme.h +++ b/src/gui/kernel/qplatformtheme.h @@ -117,7 +117,8 @@ public: TouchDoubleTapDistance, ShowShortcutsInContextMenus, IconFallbackSearchPaths, - MouseQuickSelectionThreshold + MouseQuickSelectionThreshold, + InteractiveResizeAcrossScreens, }; enum DialogType { diff --git a/src/plugins/platforms/cocoa/qcocoatheme.mm b/src/plugins/platforms/cocoa/qcocoatheme.mm index f88569df05..1bfa4b73ea 100644 --- a/src/plugins/platforms/cocoa/qcocoatheme.mm +++ b/src/plugins/platforms/cocoa/qcocoatheme.mm @@ -519,6 +519,8 @@ QVariant QCocoaTheme::themeHint(ThemeHint hint) const return QVariant(int(QTextCharFormat::DotLine)); case QPlatformTheme::UseFullScreenForPopupMenu: return QVariant(bool([[NSApplication sharedApplication] presentationOptions] & NSApplicationPresentationFullScreen)); + case QPlatformTheme::InteractiveResizeAcrossScreens: + return !NSScreen.screensHaveSeparateSpaces; default: break; } diff --git a/src/widgets/widgets/qsizegrip.cpp b/src/widgets/widgets/qsizegrip.cpp index be9ec0a580..92042f31df 100644 --- a/src/widgets/widgets/qsizegrip.cpp +++ b/src/widgets/widgets/qsizegrip.cpp @@ -50,6 +50,8 @@ #include "qdebug.h" #include +#include "private/qapplication_p.h" +#include #include QT_BEGIN_NAMESPACE @@ -313,8 +315,12 @@ void QSizeGrip::mousePressEvent(QMouseEvent * e) QRect availableGeometry; bool hasVerticalSizeConstraint = true; bool hasHorizontalSizeConstraint = true; - if (tlw->isWindow()) - availableGeometry = QWidgetPrivate::availableScreenGeometry(tlw); + if (tlw->isWindow()) { + if (QGuiApplicationPrivate::platformTheme()->themeHint(QPlatformTheme::InteractiveResizeAcrossScreens).toBool()) + availableGeometry = tlw->screen()->availableVirtualGeometry(); + else + availableGeometry = QWidgetPrivate::availableScreenGeometry(tlw); + } else { const QWidget *tlwParent = tlw->parentWidget(); // Check if tlw is inside QAbstractScrollArea/QScrollArea.