cursor: fix m_cursorSurfaceInfo not being updated while a cursor override is set (#12327)

This commit is contained in:
Giacomo Zama 2025-11-16 18:43:55 +01:00 committed by GitHub
parent 5b373ea9f5
commit b04e8e00b0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -50,9 +50,6 @@
CInputManager::CInputManager() {
m_listeners.setCursorShape = PROTO::cursorShape->m_events.setShape.listen([this](const CCursorShapeProtocol::SSetShapeEvent& event) {
if (!cursorImageUnlocked())
return;
if (!g_pSeatManager->m_state.pointerFocusResource)
return;
@ -66,6 +63,9 @@ CInputManager::CInputManager() {
m_cursorSurfaceInfo.name = event.shapeName;
m_cursorSurfaceInfo.hidden = false;
if (!cursorImageUnlocked())
return;
g_pHyprRenderer->setCursorFromName(m_cursorSurfaceInfo.name);
});
@ -653,9 +653,6 @@ void CInputManager::onMouseButton(IPointer::SButtonEvent e) {
}
void CInputManager::processMouseRequest(const CSeatManager::SSetCursorEvent& event) {
if (!cursorImageUnlocked())
return;
Debug::log(LOG, "cursorImage request: surface {:x}", rc<uintptr_t>(event.surf.get()));
if (event.surf != m_cursorSurfaceInfo.wlSurface->resource()) {
@ -675,6 +672,9 @@ void CInputManager::processMouseRequest(const CSeatManager::SSetCursorEvent& eve
m_cursorSurfaceInfo.name = "";
if (!cursorImageUnlocked())
return;
g_pHyprRenderer->setCursorSurface(m_cursorSurfaceInfo.wlSurface, event.hotspot.x, event.hotspot.y);
}