Commit e88033f9 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

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

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

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.
parent 24d865ea
......@@ -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();
Supports Markdown
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