diff --git a/src/scene/cursoritem.cpp b/src/scene/cursoritem.cpp index 94fa958698..7cb7adc708 100644 --- a/src/scene/cursoritem.cpp +++ b/src/scene/cursoritem.cpp @@ -11,6 +11,8 @@ #include "scene/itemrenderer.h" #include "scene/scene.h" #include "scene/surfaceitem_wayland.h" +#include "wayland/surface_interface.h" +#include "wayland_server.h" namespace KWin { @@ -30,7 +32,12 @@ void CursorItem::refresh() { const CursorSource *source = Cursors::self()->currentCursor()->source(); if (auto surfaceSource = qobject_cast(source)) { - setSurface(surfaceSource->surface()); + // TODO Plasma 6: Stop setting XCURSOR_SIZE and scale Xcursor.size in xrdb. + if (surfaceSource->surface() && surfaceSource->surface()->client() == waylandServer()->xWaylandConnection()) { + setImage(surfaceSource->image()); + } else { + setSurface(surfaceSource->surface()); + } } else if (auto imageSource = qobject_cast(source)) { setImage(imageSource->image()); } else if (auto shapeSource = qobject_cast(source)) {