diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-04-17 12:00:31 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-17 12:00:31 +0200 |
| commit | 74dbf196c1676c964821e4023bd5a4759485c977 (patch) | |
| tree | 3ac4837b91661afe55eaef5abcdd438f436911ee /src/layout/DwindleLayout.cpp | |
| parent | 24df15105ee2fc7f2975ef2958c2e7b1258569d1 (diff) | |
| parent | baa9e0caea3ce76f72def6e89659dd851f25831d (diff) | |
Merge pull request #39 from vaxerski/damage-tracking
Added damage tracking
Diffstat (limited to 'src/layout/DwindleLayout.cpp')
| -rw-r--r-- | src/layout/DwindleLayout.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/layout/DwindleLayout.cpp b/src/layout/DwindleLayout.cpp index aeddbb8f..2af7a2e2 100644 --- a/src/layout/DwindleLayout.cpp +++ b/src/layout/DwindleLayout.cpp @@ -412,6 +412,8 @@ void CHyprDwindleLayout::onBeginDragWindow() { m_vBeginDragPositionXY = DRAGGINGWINDOW->m_vRealPosition; m_vBeginDragSizeXY = DRAGGINGWINDOW->m_vRealSize; m_vLastDragXY = m_vBeginDragXY; + + g_pHyprRenderer->damageWindow(DRAGGINGWINDOW); } void CHyprDwindleLayout::onEndDragWindow() { @@ -422,6 +424,7 @@ void CHyprDwindleLayout::onEndDragWindow() { changeWindowFloatingMode(DRAGGINGWINDOW); } + g_pHyprRenderer->damageWindow(DRAGGINGWINDOW); } void CHyprDwindleLayout::onMouseMove(const Vector2D& mousePos) { @@ -433,8 +436,14 @@ void CHyprDwindleLayout::onMouseMove(const Vector2D& mousePos) { const auto DELTA = Vector2D(mousePos.x - m_vBeginDragXY.x, mousePos.y - m_vBeginDragXY.y); const auto TICKDELTA = Vector2D(mousePos.x - m_vLastDragXY.x, mousePos.y - m_vLastDragXY.y); + + if (abs(TICKDELTA.x) < 1.f && abs(TICKDELTA.y) < 1.f) + return; + m_vLastDragXY = mousePos; + g_pHyprRenderer->damageWindow(DRAGGINGWINDOW); + if (g_pInputManager->dragButton == BTN_LEFT) { DRAGGINGWINDOW->m_vRealPosition = m_vBeginDragPositionXY + DELTA; DRAGGINGWINDOW->m_vEffectivePosition = DRAGGINGWINDOW->m_vRealPosition; @@ -515,6 +524,8 @@ void CHyprDwindleLayout::onMouseMove(const Vector2D& mousePos) { DRAGGINGWINDOW->m_iMonitorID = PMONITOR->ID; DRAGGINGWINDOW->m_iWorkspaceID = PMONITOR->activeWorkspace; } + + g_pHyprRenderer->damageWindow(DRAGGINGWINDOW); } void CHyprDwindleLayout::onWindowCreatedFloating(CWindow* pWindow) { |
