protocols: implement image-capture-source-v1 and image-copy-capture-v1 (#11709)

Implements the new screencopy protocols
This commit is contained in:
Ikalco 2026-02-22 06:30:11 -06:00 committed by GitHub
parent 93dbf88426
commit b4ee4674f9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
37 changed files with 2585 additions and 1078 deletions

View file

@ -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();
CBox getCursorBoxLogicalForMonitor(PHLMONITOR pMonitor);
Vector2D transformedHotspot(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;
SCursorImage m_currentCursorImage; // TODO: support various sizes per-output so we can have pixel-perfect cursors
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
Vector2D m_pointerPos = {0, 0};
Vector2D m_pointerPos = {0, 0};
struct SMonitorPointerState {
SMonitorPointerState(const PHLMONITOR& m) : monitor(m) {}