diff --git a/layers.cpp b/layers.cpp --- a/layers.cpp +++ b/layers.cpp @@ -222,8 +222,10 @@ cl = new xcb_window_t[ manual_overlays.count() + stacking_order.count()]; pos = 0; for (auto it = stacking_order.constBegin(); it != stacking_order.constEnd(); ++it) { - if ((*it)->isClient()) - cl[pos++] = (*it)->window(); + X11Client *client = qobject_cast(*it); + if (client) { + cl[pos++] = client->window(); + } } for (const auto win : manual_overlays) { cl[pos++] = win; diff --git a/plugins/scenes/qpainter/scene_qpainter.cpp b/plugins/scenes/qpainter/scene_qpainter.cpp --- a/plugins/scenes/qpainter/scene_qpainter.cpp +++ b/plugins/scenes/qpainter/scene_qpainter.cpp @@ -243,6 +243,19 @@ } } +static bool isXwaylandClient(Toplevel *toplevel) +{ + X11Client *client = qobject_cast(toplevel); + if (client) { + return true; + } + Deleted *deleted = qobject_cast(toplevel); + if (deleted) { + return deleted->wasX11Client(); + } + return false; +} + void SceneQPainter::Window::performPaint(int mask, QRegion region, WindowPaintData data) { if (!(mask & (PAINT_WINDOW_TRANSFORMED | PAINT_SCREEN_TRANSFORMED))) @@ -289,7 +302,7 @@ // render content QRect source; QRect target; - if (toplevel->isClient()) { + if (isXwaylandClient(toplevel)) { // special case for XWayland windows source = QRect(toplevel->clientPos(), toplevel->clientSize()); target = source;