wayland: Fix blank window thumbnails

With the introduction of stripped down window items, the WindowPixmap
objects no longer form a hierarchy. WindowPixmap::children() method was
removed.

Surprisingly, the removal of the children() method didn't result in a
compilation error because the QObject class has a method with the same
name.

Currently, a window pixmap will have no QObject children even if the
associated wayland surface has child sub-surfaces. This may result in
blank thumbnails of apps that use sub-surfaces, e.g. Firefox. In order
to fix that issue, we need to check if there are child items instead.
This commit is contained in:
Vlad Zahorodnii 2021-04-08 22:07:40 +03:00
parent 24d865ea38
commit e88033f914

View file

@ -1570,11 +1570,13 @@ void OpenGLWindow::performPaint(int mask, const QRegion &region, const WindowPai
QSharedPointer<GLTexture> OpenGLWindow::windowTexture()
{
OpenGLWindowPixmap *frame = nullptr;
if (surfaceItem()) {
frame = static_cast<OpenGLWindowPixmap *>(surfaceItem()->windowPixmap());
const SurfaceItem *item = surfaceItem();
if (item) {
frame = static_cast<OpenGLWindowPixmap *>(item->windowPixmap());
}
if (frame && frame->children().isEmpty()) {
if (frame && item->childItems().isEmpty()) {
return QSharedPointer<GLTexture>(new GLTexture(*frame->texture()));
} else {
auto effectWindow = window()->effectWindow();