summaryrefslogtreecommitdiff
path: root/src/managers/input/InputManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/managers/input/InputManager.cpp')
-rw-r--r--src/managers/input/InputManager.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp
index 4c5de729..0665e0d2 100644
--- a/src/managers/input/InputManager.cpp
+++ b/src/managers/input/InputManager.cpp
@@ -36,6 +36,8 @@
#include "../../managers/EventManager.hpp"
#include "../../managers/LayoutManager.hpp"
+#include "../../helpers/time/Time.hpp"
+
#include <aquamarine/input/Input.hpp>
CInputManager::CInputManager() {
@@ -142,10 +144,8 @@ void CInputManager::onMouseWarp(IPointer::SMotionAbsoluteEvent e) {
}
void CInputManager::simulateMouseMovement() {
- timespec now;
- clock_gettime(CLOCK_MONOTONIC, &now);
m_vLastCursorPosFloored = m_vLastCursorPosFloored - Vector2D(1, 1); // hack: force the mouseMoveUnified to report without making this a refocus.
- mouseMoveUnified(now.tv_sec * 1000 + now.tv_nsec / 10000000);
+ mouseMoveUnified(Time::millis(Time::steadyNow()));
}
void CInputManager::sendMotionEventsToFocused() {
@@ -156,9 +156,6 @@ void CInputManager::sendMotionEventsToFocused() {
const auto PWINDOW = g_pCompositor->getWindowFromSurface(g_pCompositor->m_pLastFocus.lock());
const auto PLS = g_pCompositor->getLayerSurfaceFromSurface(g_pCompositor->m_pLastFocus.lock());
- timespec now;
- clock_gettime(CLOCK_MONOTONIC, &now);
-
const auto LOCAL = getMouseCoordsInternal() - (PWINDOW ? PWINDOW->m_vRealPosition->goal() : (PLS ? Vector2D{PLS->geometry.x, PLS->geometry.y} : Vector2D{}));
m_bEmptyFocusCursorSet = false;
@@ -1746,11 +1743,8 @@ void CInputManager::releaseAllMouseButtons() {
if (PROTO::data->dndActive())
return;
- timespec now;
- clock_gettime(CLOCK_MONOTONIC, &now);
-
for (auto const& mb : buttonsCopy) {
- g_pSeatManager->sendPointerButton(now.tv_sec * 1000 + now.tv_nsec / 1000000, mb, WL_POINTER_BUTTON_STATE_RELEASED);
+ g_pSeatManager->sendPointerButton(Time::millis(Time::steadyNow()), mb, WL_POINTER_BUTTON_STATE_RELEASED);
}
m_lCurrentlyHeldButtons.clear();