diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-03-04 00:14:20 +0000 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-03-04 00:14:20 +0000 |
| commit | fb45f8f2f9efd988f2f5cef5cf74d6cba19e6b0c (patch) | |
| tree | 495b83f741440514dc0828e7b1204d842b3e55a9 /src/layout/IHyprLayout.cpp | |
| parent | c1217066d1e7c6cd12f43134f9ef1145787f7905 (diff) | |
crashReporter: remove inconsistent log from crash reports
Diffstat (limited to 'src/layout/IHyprLayout.cpp')
| -rw-r--r-- | src/layout/IHyprLayout.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/layout/IHyprLayout.cpp b/src/layout/IHyprLayout.cpp index 6a1ff572..37f8a9b0 100644 --- a/src/layout/IHyprLayout.cpp +++ b/src/layout/IHyprLayout.cpp @@ -267,17 +267,23 @@ void IHyprLayout::onMouseMove(const Vector2D& mousePos) { return; } - const auto SPECIAL = g_pCompositor->isWorkspaceSpecial(DRAGGINGWINDOW->m_iWorkspaceID); + static auto TIMER = std::chrono::high_resolution_clock::now(); - 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); + const auto SPECIAL = g_pCompositor->isWorkspaceSpecial(DRAGGINGWINDOW->m_iWorkspaceID); - const auto PANIMATEMOUSE = &g_pConfigManager->getConfigValuePtr("misc:animate_mouse_windowdragging")->intValue; - const auto PANIMATE = &g_pConfigManager->getConfigValuePtr("misc:animate_manual_resizes")->intValue; + 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) + const auto PANIMATEMOUSE = &g_pConfigManager->getConfigValuePtr("misc:animate_mouse_windowdragging")->intValue; + const auto PANIMATE = &g_pConfigManager->getConfigValuePtr("misc:animate_manual_resizes")->intValue; + + if ((abs(TICKDELTA.x) < 1.f && abs(TICKDELTA.y) < 1.f) || + (std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::high_resolution_clock::now() - TIMER).count() < + 1000.0 / g_pHyprRenderer->m_pMostHzMonitor->refreshRate)) return; + TIMER = std::chrono::high_resolution_clock::now(); + m_vLastDragXY = mousePos; g_pHyprRenderer->damageWindow(DRAGGINGWINDOW); |
