diff options
author | Vaxry <[email protected]> | 2024-11-10 20:17:31 +0000 |
---|---|---|
committer | Vaxry <[email protected]> | 2024-11-11 13:16:40 +0000 |
commit | f5ab88e770890259329341cf7a9e7f625bf8e811 (patch) | |
tree | 09ba785dc1c463d751969ff4661c9f6508f61406 | |
parent | 80e885f37490d9b711f23eb06c645cd1a6586371 (diff) | |
download | Hyprland-f5ab88e770890259329341cf7a9e7f625bf8e811.tar.gz Hyprland-f5ab88e770890259329341cf7a9e7f625bf8e811.zip |
thanks ujin
-rw-r--r-- | src/managers/PointerManager.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/managers/PointerManager.cpp b/src/managers/PointerManager.cpp index a98a0228..d6189acd 100644 --- a/src/managers/PointerManager.cpp +++ b/src/managers/PointerManager.cpp @@ -459,7 +459,13 @@ SP<Aquamarine::IBuffer> CPointerManager::renderHWCursorBuffer(SP<CPointerManager auto [data, fmt, size] = buf->beginDataPtr(0); - memcpy(data, texData.data(), std::min(size, texData.size())); + memset(data, 0, size); + if (buf->dmabuf().size.x > texture->m_vSize.x) { + size_t STRIDE = 4 * texture->m_vSize.x; + for (int i = 0; i < texture->m_vSize.y; i++) + memcpy(data + i * buf->dmabuf().strides[0], texData.data() + i * STRIDE, STRIDE); + } else + memcpy(data, texData.data(), std::min(size, texData.size())); buf->endDataPtr(); |