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

@@ -1940,11 +1940,23 @@ bool CHyprRenderer::applyMonitorRule(CMonitor* pMonitor, SMonitorRule* pMonitorR
void CHyprRenderer::setCursorSurface(wlr_surface* surf, int hotspotX, int hotspotY) {
m_bCursorHasSurface = surf;
if (surf == m_sLastCursorData.surf)
return;
m_sLastCursorData.name = "";
m_sLastCursorData.surf = surf;
wlr_cursor_set_surface(g_pCompositor->m_sWLRCursor, surf, hotspotX, hotspotY);
}
void CHyprRenderer::setCursorFromName(const std::string& name) {
m_bCursorHasSurface = true;
if (name == m_sLastCursorData.name)
return;
m_sLastCursorData.name = name;
m_sLastCursorData.surf = nullptr;
wlr_cursor_set_xcursor(g_pCompositor->m_sWLRCursor, g_pCompositor->m_sWLRXCursorMgr, name.c_str());
}