vcl/qt5/QtObject.cxx | 5 +++++
1 file changed, 5 insertions(+)
New commits:
commit 359cdd6b3b401519621dd10fc072305d627dccc0
Author: Michael Weghorn <[email protected]>
AuthorDate: Fri Jun 21 20:39:46 2024 +0200
Commit: Michael Weghorn <[email protected]>
CommitDate: Sat Jun 22 06:56:37 2024 +0200
tdf#149461 qt5: Provide a QWindow for OpenGL rendering on X11
When using the qt5 or kf5 VCL plugins on X11/XWayland
(as can be forced using QT_QPA_PLUGIN=xcb on Wayland),
ensure that a QWindow exists for the QtObjectWidget
created in the QtObject ctor, as that is needed for
OpenGL rendering.
This makes OpenGL Impress slide transitions like the
"Tiles" one work.
Don't force native windows on Wayland, as that causes
other issues, see also QtFrame::ResolveWindowHandle
and the bugs referenced in there.
Change-Id: I8fac34d2f1cc7cc723ad4570546276a05641dd88
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169348
Reviewed-by: Michael Weghorn <[email protected]>
Tested-by: Jenkins
(cherry picked from commit 89372e62454a72c6c400f00bfe3221bc0fe6d23e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169367
diff --git a/vcl/qt5/QtObject.cxx b/vcl/qt5/QtObject.cxx
index b9f1b804f95c..8c9535b41f20 100644
--- a/vcl/qt5/QtObject.cxx
+++ b/vcl/qt5/QtObject.cxx
@@ -48,6 +48,11 @@ QtObject::QtObject(QtFrame* pParent, bool bShow)
// which is not a problem with the QtMultimedia approach that the qt6
VCL plugin uses;
// stay with the QtObjectWidget introduced in commit
4366e0605214260e55a937173b0c2e02225dc843
m_pQWidget = new QtObjectWidget(*this);
+
+ // invoke QWidget::winId() to ensure a native window for OpenGL
rendering is available on X11,
+ // don't do it on Wayland, as that breaks rendering otherwise, s.a.
QtFrame::ResolveWindowHandle
+ if (QGuiApplication::platformName() == "xcb")
+ m_pQWidget->winId();
m_pQWindow = m_pQWidget->windowHandle();
}