pointermgr: revert "damage only the surface size (#13284)"

This reverts commit 13dab66b1d.
This commit is contained in:
Vaxry 2026-02-22 12:23:27 +00:00
parent 0eb4755a3e
commit 93dbf88426
No known key found for this signature in database
GPG key ID: 665806380871D640

View file

@ -399,25 +399,21 @@ bool CPointerManager::setHWCursorBuffer(SP<SMonitorPointerState> state, SP<Aquam
SP<Aquamarine::IBuffer> CPointerManager::renderHWCursorBuffer(SP<CPointerManager::SMonitorPointerState> state, SP<CTexture> texture) { SP<Aquamarine::IBuffer> CPointerManager::renderHWCursorBuffer(SP<CPointerManager::SMonitorPointerState> state, SP<CTexture> texture) {
auto maxSize = state->monitor->m_output->cursorPlaneSize(); 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 const& cursorSize = m_currentCursorImage.size; auto const& cursorSize = m_currentCursorImage.size;
static auto PCPUBUFFER = CConfigValue<Hyprlang::INT>("cursor:use_cpu_buffer"); static auto PCPUBUFFER = CConfigValue<Hyprlang::INT>("cursor:use_cpu_buffer");
const bool shouldUseCpuBuffer = *PCPUBUFFER == 1 || (*PCPUBUFFER != 0 && g_pHyprRenderer->isNvidia()); const bool shouldUseCpuBuffer = *PCPUBUFFER == 1 || (*PCPUBUFFER != 0 && g_pHyprRenderer->isNvidia());
if (maxSize == Vector2D{})
return nullptr;
if (maxSize != Vector2D{-1, -1}) {
if (cursorSize.x > maxSize.x || cursorSize.y > maxSize.y) { if (cursorSize.x > maxSize.x || cursorSize.y > maxSize.y) {
Log::logger->log(Log::TRACE, "hardware cursor too big! {} > {}", m_currentCursorImage.size, maxSize); Log::logger->log(Log::TRACE, "hardware cursor too big! {} > {}", m_currentCursorImage.size, maxSize);
return nullptr; return nullptr;
} }
} else
maxSize = cursorSize; maxSize = cursorSize;
if (!state->monitor->m_cursorSwapchain || maxSize != state->monitor->m_cursorSwapchain->currentOptions().size || if (!state->monitor->m_cursorSwapchain || maxSize != state->monitor->m_cursorSwapchain->currentOptions().size ||
@ -584,7 +580,8 @@ SP<Aquamarine::IBuffer> CPointerManager::renderHWCursorBuffer(SP<CPointerManager
RBO->bind(); RBO->bind();
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. 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()}; CBox xbox = {{}, Vector2D{m_currentCursorImage.size / m_currentCursorImage.scale * state->monitor->m_scale}.round()};