diff options
author | Liang Qi <liang.qi@qt.io> | 2022-03-08 11:46:48 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2022-03-17 14:27:44 +0100 |
commit | f08e57540d217e16d1d15e5638afafac17439c0d (patch) | |
tree | 0b8561b33828624b666890f38a9033e62470ff0b /src/gui/kernel | |
parent | 9619cec2792354c8bdcba86639a60cf040978376 (diff) |
GUI: add ScreenWindowGrabbing capability
On Wayland, there is no protocol to do it yet.
Task-number: QTBUG-100792
Task-number: QTBUG-101145
Change-Id: Id72625a8161359111a2d0f43f3215e787778ba6b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qplatformintegration.cpp | 7 | ||||
-rw-r--r-- | src/gui/kernel/qplatformintegration.h | 3 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/gui/kernel/qplatformintegration.cpp b/src/gui/kernel/qplatformintegration.cpp index 1427db5c61..c6382243b9 100644 --- a/src/gui/kernel/qplatformintegration.cpp +++ b/src/gui/kernel/qplatformintegration.cpp @@ -260,6 +260,10 @@ QPlatformServices *QPlatformIntegration::services() const where there is an alternative, such as Qt Quick with its \c software backend, an automatic fallback to that alternative may occur, if applicable. The default implementation of hasCapability() returns \c true. + + \value ScreenWindowGrabbing The platform supports grabbing window on screen. + On Wayland, this capability can be reported as \c false. The default implementation + of hasCapability() returns \c true. */ /*! @@ -284,7 +288,8 @@ QPlatformServices *QPlatformIntegration::services() const bool QPlatformIntegration::hasCapability(Capability cap) const { return cap == NonFullScreenWindows || cap == NativeWidgets || cap == WindowManagement - || cap == TopStackedNativeChildWindows || cap == WindowActivation || cap == RhiBasedRendering; + || cap == TopStackedNativeChildWindows || cap == WindowActivation + || cap == RhiBasedRendering || cap == ScreenWindowGrabbing; } QPlatformPixmap *QPlatformIntegration::createPlatformPixmap(QPlatformPixmap::PixelType type) const diff --git a/src/gui/kernel/qplatformintegration.h b/src/gui/kernel/qplatformintegration.h index 75b942f998..d76aeee59e 100644 --- a/src/gui/kernel/qplatformintegration.h +++ b/src/gui/kernel/qplatformintegration.h @@ -133,7 +133,8 @@ public: OpenGLOnRasterSurface, MaximizeUsingFullscreenGeometry, PaintEvents, - RhiBasedRendering + RhiBasedRendering, + ScreenWindowGrabbing // whether QScreen::grabWindow() is supported }; virtual ~QPlatformIntegration() { } |