From b4ee4674f9a74e3d602c7fb17bc09f79d221583c Mon Sep 17 00:00:00 2001 From: Ikalco <73481042+ikalco@users.noreply.github.com> Date: Sun, 22 Feb 2026 06:30:11 -0600 Subject: protocols: implement image-capture-source-v1 and image-copy-capture-v1 (#11709) Implements the new screencopy protocols --- src/managers/PointerManager.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/managers/PointerManager.cpp') diff --git a/src/managers/PointerManager.cpp b/src/managers/PointerManager.cpp index 2d752ea7..60964d4d 100644 --- a/src/managers/PointerManager.cpp +++ b/src/managers/PointerManager.cpp @@ -96,6 +96,10 @@ Vector2D CPointerManager::position() { return m_pointerPos; } +Vector2D CPointerManager::hotspot() { + return m_currentCursorImage.hotspot; +} + bool CPointerManager::hasCursor() { return m_currentCursorImage.pBuffer || m_currentCursorImage.surface; } @@ -115,6 +119,7 @@ void CPointerManager::setCursorBuffer(SP buf, const Vector2 m_currentCursorImage.scale = scale; updateCursorBackend(); damageIfSoftware(); + m_events.cursorChanged.emit(); } return; @@ -132,6 +137,7 @@ void CPointerManager::setCursorBuffer(SP buf, const Vector2 updateCursorBackend(); damageIfSoftware(); + m_events.cursorChanged.emit(); } void CPointerManager::setCursorSurface(SP surf, const Vector2D& hotspot) { @@ -143,6 +149,7 @@ void CPointerManager::setCursorSurface(SP surf, const m_currentCursorImage.scale = surf && surf->resource() ? surf->resource()->m_current.scale : 1.F; updateCursorBackend(); damageIfSoftware(); + m_events.cursorChanged.emit(); } return; @@ -164,6 +171,7 @@ void CPointerManager::setCursorSurface(SP surf, const recheckEnteredOutputs(); updateCursorBackend(); damageIfSoftware(); + m_events.cursorChanged.emit(); }); if (surf->resource()->m_current.texture) { @@ -177,6 +185,7 @@ void CPointerManager::setCursorSurface(SP surf, const recheckEnteredOutputs(); updateCursorBackend(); damageIfSoftware(); + m_events.cursorChanged.emit(); } void CPointerManager::recheckEnteredOutputs() { @@ -261,6 +270,8 @@ void CPointerManager::resetCursorImage(bool apply) { ms->cursorFrontBuffer = nullptr; } } + + m_events.cursorChanged.emit(); } void CPointerManager::updateCursorBackend() { @@ -888,6 +899,10 @@ void CPointerManager::onMonitorLayoutChange() { damageIfSoftware(); } +const CPointerManager::SCursorImage& CPointerManager::currentCursorImage() { + return m_currentCursorImage; +} + SP CPointerManager::getCurrentCursorTexture() { if (!m_currentCursorImage.pBuffer && (!m_currentCursorImage.surface || !m_currentCursorImage.surface->resource()->m_current.texture)) return nullptr; -- cgit v1.2.3