From 89372e62454a72c6c400f00bfe3221bc0fe6d23e Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Fri, 21 Jun 2024 20:39:46 +0200 Subject: [PATCH] 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 Tested-by: Jenkins --- vcl/qt5/QtObject.cxx | 5 +++++ 1 file changed, 5 insertions(+) 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(); }