From 93dbf884261efcb387e920b1cd0e4ed5b288bc3a Mon Sep 17 00:00:00 2001 From: Vaxry Date: Sun, 22 Feb 2026 12:23:27 +0000 Subject: pointermgr: revert "damage only the surface size (#13284)" This reverts commit 13dab66b1de6f6689ccd078adaf51bbeab9c004d. --- src/managers/PointerManager.cpp | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/src/managers/PointerManager.cpp b/src/managers/PointerManager.cpp index 2d4b9502..2d752ea7 100644 --- a/src/managers/PointerManager.cpp +++ b/src/managers/PointerManager.cpp @@ -398,27 +398,23 @@ bool CPointerManager::setHWCursorBuffer(SP state, SP CPointerManager::renderHWCursorBuffer(SP state, SP texture) { - auto maxSize = state->monitor->m_output->cursorPlaneSize(); - - if (maxSize == Vector2D{}) - return nullptr; - else if (maxSize == Vector2D{-1, -1}) { - Log::logger->log(Log::TRACE, "cursor plane size is unlimited, falling back to 256x256"); - maxSize = Vector2D{256, 256}; - } - - auto const damage = maxSize; + auto maxSize = state->monitor->m_output->cursorPlaneSize(); auto const& cursorSize = m_currentCursorImage.size; - static auto PCPUBUFFER = CConfigValue("cursor:use_cpu_buffer"); + static auto PCPUBUFFER = CConfigValue("cursor:use_cpu_buffer"); + const bool shouldUseCpuBuffer = *PCPUBUFFER == 1 || (*PCPUBUFFER != 0 && g_pHyprRenderer->isNvidia()); - if (cursorSize.x > maxSize.x || cursorSize.y > maxSize.y) { - Log::logger->log(Log::TRACE, "hardware cursor too big! {} > {}", m_currentCursorImage.size, maxSize); + if (maxSize == Vector2D{}) return nullptr; - } - maxSize = cursorSize; + if (maxSize != Vector2D{-1, -1}) { + if (cursorSize.x > maxSize.x || cursorSize.y > maxSize.y) { + Log::logger->log(Log::TRACE, "hardware cursor too big! {} > {}", m_currentCursorImage.size, maxSize); + return nullptr; + } + } else + maxSize = cursorSize; if (!state->monitor->m_cursorSwapchain || maxSize != state->monitor->m_cursorSwapchain->currentOptions().size || shouldUseCpuBuffer != (state->monitor->m_cursorSwapchain->getAllocator()->type() != Aquamarine::AQ_ALLOCATOR_TYPE_GBM)) { @@ -584,7 +580,8 @@ SP CPointerManager::renderHWCursorBuffer(SPbind(); - g_pHyprOpenGL->beginSimple(state->monitor.lock(), {0, 0, damage.x, damage.y}, RBO); + const auto& damageSize = state->monitor->m_output->cursorPlaneSize(); + g_pHyprOpenGL->beginSimple(state->monitor.lock(), {0, 0, damageSize.x, damageSize.y}, RBO); g_pHyprOpenGL->clear(CHyprColor{0.F, 0.F, 0.F, 0.F}); // ensure the RBO is zero initialized. CBox xbox = {{}, Vector2D{m_currentCursorImage.size / m_currentCursorImage.scale * state->monitor->m_scale}.round()}; -- cgit v1.2.3