| 746 | } |
| 747 | |
| 748 | CursorImage::CursorImage(PointerInputRedirection *parent) |
| 749 | : QObject(parent) |
| 750 | , m_pointer(parent) |
| 751 | { |
| 752 | m_effectsCursor = std::make_unique<ShapeCursorSource>(); |
| 753 | m_fallbackCursor = std::make_unique<ShapeCursorSource>(); |
| 754 | m_moveResizeCursor = std::make_unique<ShapeCursorSource>(); |
| 755 | m_windowSelectionCursor = std::make_unique<ShapeCursorSource>(); |
| 756 | m_decoration.cursor = std::make_unique<ShapeCursorSource>(); |
| 757 | |
| 758 | #if KWIN_BUILD_SCREENLOCKER |
| 759 | if (kwinApp()->supportsLockScreen()) { |
| 760 | connect(ScreenLocker::KSldApp::self(), &ScreenLocker::KSldApp::lockStateChanged, this, &CursorImage::reevaluteSource); |
| 761 | } |
| 762 | #endif |
| 763 | connect(m_pointer, &PointerInputRedirection::decorationChanged, this, &CursorImage::updateDecoration); |
| 764 | // connect the move resize of all window |
| 765 | auto setupMoveResizeConnection = [this](Window *window) { |
| 766 | connect(window, &Window::moveResizedChanged, this, &CursorImage::updateMoveResize); |
| 767 | connect(window, &Window::moveResizeCursorChanged, this, &CursorImage::updateMoveResize); |
| 768 | }; |
| 769 | const auto clients = workspace()->windows(); |
| 770 | std::for_each(clients.begin(), clients.end(), setupMoveResizeConnection); |
| 771 | connect(workspace(), &Workspace::windowAdded, this, setupMoveResizeConnection); |
| 772 | |
| 773 | m_fallbackCursor->setShape(Qt::ArrowCursor); |
| 774 | |
| 775 | reevaluteSource(); |
| 776 | } |
| 777 | |
| 778 | CursorImage::~CursorImage() = default; |
| 779 | |