Commit 60ab2125 authored by Christoph Cullmann's avatar Christoph Cullmann

fix rendering artifacts introduced by calling winId

winId shall not be called on non-native widgets

just call effectiveWinId that will handle this for us

BUG: 411965


(cherry picked from commit 343bc395)
parent a6136dd8
...@@ -205,15 +205,16 @@ WId Session::windowId() const ...@@ -205,15 +205,16 @@ WId Session::windowId() const
if (_views.count() == 0) { if (_views.count() == 0) {
return 0; return 0;
} else { } else {
QWidget* window = _views.first(); /**
* compute the windows id to use
Q_ASSERT(window); * doesn't call winId on some widget, as this might lead
* to rendering artifacts as this will trigger the
while (window->parentWidget() != nullptr) { * creation of a native window, see https://doc.qt.io/qt-5/qwidget.html#winId
window = window->parentWidget(); * instead, use https://doc.qt.io/qt-5/qwidget.html#effectiveWinId
} */
QWidget* widget = _views.first();
return window->winId(); Q_ASSERT(widget);
return widget->effectiveWinId();
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment