summaryrefslogtreecommitdiff
path: root/src/managers/PointerManager.hpp
diff options
context:
space:
mode:
authorIkalco <73481042+ikalco@users.noreply.github.com>2026-02-22 06:30:11 -0600
committerGitHub <noreply@github.com>2026-02-22 12:30:11 +0000
commitb4ee4674f9a74e3d602c7fb17bc09f79d221583c (patch)
tree294bbb207c44e778dd78afda65cbd79181f04124 /src/managers/PointerManager.hpp
parent93dbf884261efcb387e920b1cd0e4ed5b288bc3a (diff)
protocols: implement image-capture-source-v1 and image-copy-capture-v1 (#11709)
Implements the new screencopy protocols
Diffstat (limited to 'src/managers/PointerManager.hpp')
-rw-r--r--src/managers/PointerManager.hpp47
1 files changed, 28 insertions, 19 deletions
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<Aquamarine::IBuffer> pBuffer;
+ SP<CTexture> bufferTex;
+ WP<Desktop::View::CWLSurface> surface;
+
+ Vector2D hotspot;
+ Vector2D size;
+ float scale = 1.F;
+
+ CHyprSignalListener destroySurface;
+ CHyprSignalListener commitSurface;
+ };
+
+ const SCursorImage& currentCursorImage();
+ SP<CTexture> 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<CTexture> getCurrentCursorTexture();
+ Vector2D transformedHotspot(PHLMONITOR pMonitor);
struct SPointerListener {
CHyprSignalListener destroy;
@@ -137,20 +157,9 @@ class CPointerManager {
std::vector<CBox> monitorBoxes;
} m_currentMonitorLayout;
- struct {
- SP<Aquamarine::IBuffer> pBuffer;
- SP<CTexture> bufferTex;
- WP<Desktop::View::CWLSurface> 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) {}