diff options
| author | Vaxry <vaxry@vaxry.net> | 2024-05-17 20:04:17 +0100 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2024-05-17 20:04:17 +0100 |
| commit | 49485ba36a2d246c6fd3b32e3d4ad94f5c115ed5 (patch) | |
| tree | 6b16f5f689b0786a445ad5c65a3617cf0be7c538 /src/managers/PointerManager.cpp | |
| parent | fe23d2b639f13db852adb5f10812f308b38d7e9b (diff) | |
pointer: damage in software mode on cursor image changes
fixes #6126
Diffstat (limited to 'src/managers/PointerManager.cpp')
| -rw-r--r-- | src/managers/PointerManager.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/managers/PointerManager.cpp b/src/managers/PointerManager.cpp index d565ad6d..4be91b80 100644 --- a/src/managers/PointerManager.cpp +++ b/src/managers/PointerManager.cpp @@ -169,11 +169,13 @@ SP<CPointerManager::SMonitorPointerState> CPointerManager::stateFor(SP<CMonitor> } void CPointerManager::setCursorBuffer(wlr_buffer* buf, const Vector2D& hotspot, const float& scale) { + damageIfSoftware(); if (buf == currentCursorImage.pBuffer) { if (hotspot != currentCursorImage.hotspot || scale != currentCursorImage.scale) { currentCursorImage.hotspot = hotspot; currentCursorImage.scale = scale; updateCursorBackend(); + damageIfSoftware(); } return; @@ -193,14 +195,18 @@ void CPointerManager::setCursorBuffer(wlr_buffer* buf, const Vector2D& hotspot, currentCursorImage.scale = scale; updateCursorBackend(); + damageIfSoftware(); } void CPointerManager::setCursorSurface(CWLSurface* surf, const Vector2D& hotspot) { + damageIfSoftware(); + if (surf == currentCursorImage.surface) { if (hotspot != currentCursorImage.hotspot || (surf && surf->wlr() ? surf->wlr()->current.scale : 1.F) != currentCursorImage.scale) { currentCursorImage.hotspot = hotspot; currentCursorImage.scale = surf && surf->wlr() ? surf->wlr()->current.scale : 1.F; updateCursorBackend(); + damageIfSoftware(); } return; @@ -217,10 +223,12 @@ void CPointerManager::setCursorSurface(CWLSurface* surf, const Vector2D& hotspot currentCursorImage.hyprListener_commitSurface.initCallback( &surf->wlr()->events.commit, [this](void* owner, void* data) { + damageIfSoftware(); currentCursorImage.size = {currentCursorImage.surface->wlr()->current.buffer_width, currentCursorImage.surface->wlr()->current.buffer_height}; currentCursorImage.scale = currentCursorImage.surface && currentCursorImage.surface->wlr() ? currentCursorImage.surface->wlr()->current.scale : 1.F; recheckEnteredOutputs(); updateCursorBackend(); + damageIfSoftware(); }, nullptr, "CPointerManager"); @@ -235,6 +243,7 @@ void CPointerManager::setCursorSurface(CWLSurface* surf, const Vector2D& hotspot recheckEnteredOutputs(); updateCursorBackend(); + damageIfSoftware(); } void CPointerManager::recheckEnteredOutputs() { @@ -276,6 +285,8 @@ void CPointerManager::recheckEnteredOutputs() { } void CPointerManager::resetCursorImage(bool apply) { + damageIfSoftware(); + if (currentCursorImage.surface) { for (auto& m : g_pCompositor->m_vMonitors) { wlr_surface_send_leave(currentCursorImage.surface->wlr(), m->output); |
