From 7a5234a0cca2508b7a5ede1fc60dc3ae8b72a51c Mon Sep 17 00:00:00 2001 From: Vaxry Date: Sun, 29 Oct 2023 18:09:05 +0000 Subject: input: better cursor image infrastructure Improves handling of cursor images/surfaces Fixes an issue with decos and cursors Fixes #3471 --- src/managers/input/InputManager.hpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'src/managers/input/InputManager.hpp') diff --git a/src/managers/input/InputManager.hpp b/src/managers/input/InputManager.hpp index 670bc4da..b4d365ee 100644 --- a/src/managers/input/InputManager.hpp +++ b/src/managers/input/InputManager.hpp @@ -229,15 +229,22 @@ class CInputManager { void setBorderCursorIcon(eBorderIconDirection); void setCursorIconOnBorder(CWindow* w); + // temporary. Obeys setUntilUnset. + void setCursorImageOverride(const std::string& name); + // cursor surface - // struct cursorSI { - // wlr_surface* pSurface = nullptr; - // Vector2D vHotspot; - // bool bUsed = false; - // } cursorSurfaceInfo; - // DYNLISTENER(CursorSurfaceDestroy); + struct cursorSI { + bool hidden = false; // null surface = hidden + CWLSurface wlSurface; + Vector2D vHotspot; + std::string name; // if not empty, means set by name. + bool inUse = false; + } m_sCursorSurfaceInfo; + + void restoreCursorIconToApp(); // no-op if restored friend class CKeybindManager; + friend class CWLSurface; }; inline std::unique_ptr g_pInputManager; -- cgit v1.2.3