diff options
| author | nyx <nnyyxxxx@protonmail.com> | 2025-04-06 17:24:14 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-06 23:24:14 +0200 |
| commit | 9b3925009aaacc236a4ed6ea91c0d1e157f2ca0a (patch) | |
| tree | 14eb3fca80e062b0bae16ee29f9277030461548a /src/protocols/core/DataDevice.cpp | |
| parent | 3c128679ee8c86bbbeb5ae38621f6de622525cf1 (diff) | |
DataDevice: position icon at cursor hotspot (#9895)
* DataDevice: position icon at cursor hotspot
ref: https://wayland.app/protocols/wayland#wl_data_device:request:start_drag
Diffstat (limited to 'src/protocols/core/DataDevice.cpp')
| -rw-r--r-- | src/protocols/core/DataDevice.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/protocols/core/DataDevice.cpp b/src/protocols/core/DataDevice.cpp index f4044ec5..83226e3a 100644 --- a/src/protocols/core/DataDevice.cpp +++ b/src/protocols/core/DataDevice.cpp @@ -808,15 +808,19 @@ void CWLDataDeviceProtocol::renderDND(PHLMONITOR pMonitor, timespec* when) { const auto POS = g_pInputManager->getMouseCoordsInternal(); - CBox box = CBox{POS, dnd.dndSurface->current.size}.translate(-pMonitor->vecPosition + g_pPointerManager->cursorSizeLogical() / 2.F).scale(pMonitor->scale); + Vector2D surfacePos = POS; + + surfacePos += dnd.dndSurface->current.offset; + + CBox box = CBox{surfacePos, dnd.dndSurface->current.size}.translate(-pMonitor->vecPosition).scale(pMonitor->scale); CTexPassElement::SRenderData data; data.tex = dnd.dndSurface->current.texture; data.box = box; g_pHyprRenderer->m_sRenderPass.add(makeShared<CTexPassElement>(data)); - box = CBox{POS, dnd.dndSurface->current.size}.translate(g_pPointerManager->cursorSizeLogical() / 2.F).expand(5); - g_pHyprRenderer->damageBox(box); + CBox damageBox = CBox{surfacePos, dnd.dndSurface->current.size}.expand(5); + g_pHyprRenderer->damageBox(damageBox); dnd.dndSurface->frame(when); } |
