mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-07-25 17:21:54 -07:00
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
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user