From 3cf76e81e51d8d38ef886542464396d0d215cd3e Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Tue, 13 May 2025 14:36:21 +0200 Subject: [PATCH] offscreen: Return the requested window format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Not the default constructed QSurfaceFormat. If the window had alphaBufferSize set to some value, we want that value returned from the platformwindow too. Pick-to: 6.8 Task-number: QTBUG-136755 Change-Id: Ie0b51b773e0127cac797607a52947bba7ec5eba0 Reviewed-by: Tor Arne Vestbø (cherry picked from commit d22660a09d36818d4c39a6e6b85430c377849dfe) Reviewed-by: Qt Cherry-pick Bot --- src/plugins/platforms/offscreen/qoffscreenwindow.cpp | 5 +++++ src/plugins/platforms/offscreen/qoffscreenwindow.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/plugins/platforms/offscreen/qoffscreenwindow.cpp b/src/plugins/platforms/offscreen/qoffscreenwindow.cpp index 1a1471c6874..683a2d04dde 100644 --- a/src/plugins/platforms/offscreen/qoffscreenwindow.cpp +++ b/src/plugins/platforms/offscreen/qoffscreenwindow.cpp @@ -130,6 +130,11 @@ WId QOffscreenWindow::winId() const return m_winId; } +QSurfaceFormat QOffscreenWindow::format() const +{ + return window()->requestedFormat(); +} + QMargins QOffscreenWindow::frameMargins() const { return m_margins; diff --git a/src/plugins/platforms/offscreen/qoffscreenwindow.h b/src/plugins/platforms/offscreen/qoffscreenwindow.h index d525f2c6578..419eabbc02f 100644 --- a/src/plugins/platforms/offscreen/qoffscreenwindow.h +++ b/src/plugins/platforms/offscreen/qoffscreenwindow.h @@ -26,6 +26,7 @@ public: void requestActivateWindow() override; WId winId() const override; + QSurfaceFormat format() const override; static QOffscreenWindow *windowForWinId(WId id);