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.hpp | 47 ++++++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 19 deletions(-) (limited to 'src/managers/PointerManager.hpp') diff --git a/src/managers/PointerManager.hpp b/src/managers/PointerManager.hpp index 4b8ec65a..0109268b 100644 --- a/src/managers/PointerManager.hpp +++ b/src/managers/PointerManager.hpp @@ -60,10 +60,34 @@ class CPointerManager { // Vector2D position(); + Vector2D hotspot(); Vector2D cursorSizeLogical(); void recheckEnteredOutputs(); + // returns the thing in global coords + CBox getCursorBoxGlobal(); + + struct SCursorImage { + SP pBuffer; + SP bufferTex; + WP surface; + + Vector2D hotspot; + Vector2D size; + float scale = 1.F; + + CHyprSignalListener destroySurface; + CHyprSignalListener commitSurface; + }; + + const SCursorImage& currentCursorImage(); + SP getCurrentCursorTexture(); + + struct { + CSignalT<> cursorChanged; + } m_events; + private: void recheckPointerPosition(); void onMonitorLayoutChange(); @@ -79,13 +103,9 @@ class CPointerManager { // returns the thing in device coordinates. Is NOT offset by the hotspot, relies on set_cursor with hotspot. Vector2D getCursorPosForMonitor(PHLMONITOR pMonitor); // returns the thing in logical coordinates of the monitor - CBox getCursorBoxLogicalForMonitor(PHLMONITOR pMonitor); - // returns the thing in global coords - CBox getCursorBoxGlobal(); - - Vector2D transformedHotspot(PHLMONITOR pMonitor); + CBox getCursorBoxLogicalForMonitor(PHLMONITOR pMonitor); - SP getCurrentCursorTexture(); + Vector2D transformedHotspot(PHLMONITOR pMonitor); struct SPointerListener { CHyprSignalListener destroy; @@ -137,20 +157,9 @@ class CPointerManager { std::vector monitorBoxes; } m_currentMonitorLayout; - struct { - SP pBuffer; - SP bufferTex; - WP surface; - - Vector2D hotspot; - Vector2D size; - float scale = 1.F; - - CHyprSignalListener destroySurface; - CHyprSignalListener commitSurface; - } m_currentCursorImage; // TODO: support various sizes per-output so we can have pixel-perfect cursors + SCursorImage m_currentCursorImage; // TODO: support various sizes per-output so we can have pixel-perfect cursors - Vector2D m_pointerPos = {0, 0}; + Vector2D m_pointerPos = {0, 0}; struct SMonitorPointerState { SMonitorPointerState(const PHLMONITOR& m) : monitor(m) {} -- cgit v1.2.3