diff --git a/layers.cpp b/layers.cpp index 151ff9dfc5..a15a8c7126 100644 --- a/layers.cpp +++ b/layers.cpp @@ -222,8 +222,10 @@ void Workspace::propagateClients(bool propagate_new_clients) 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 index 93b6c49c1e..5f77465558 100644 --- a/plugins/scenes/qpainter/scene_qpainter.cpp +++ b/plugins/scenes/qpainter/scene_qpainter.cpp @@ -243,6 +243,19 @@ static void paintSubSurface(QPainter *painter, const QPoint &pos, QPainterWindow } } +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 @@ void SceneQPainter::Window::performPaint(int mask, QRegion region, WindowPaintDa // 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;