input: better cursor image infrastructure

Improves handling of cursor images/surfaces
Fixes an issue with decos and cursors
Fixes #3471
This commit is contained in:
Vaxry
2023-10-29 18:09:05 +00:00
parent af9440152e
commit 7a5234a0cc
7 changed files with 100 additions and 21 deletions

View File

@@ -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<CInputManager> g_pInputManager;