time: move to stl's clocks and move timer

This commit is contained in:
Vaxry 2025-04-16 01:37:48 +01:00
parent 0e521788bc
commit 877fb5b93a
43 changed files with 392 additions and 248 deletions

View file

@ -4,6 +4,7 @@
#include "../../devices/IKeyboard.hpp"
#include "../../devices/IHID.hpp"
#include "../../managers/SeatManager.hpp"
#include "../../helpers/time/Time.hpp"
#include "../../config/ConfigValue.hpp"
#include <algorithm>
@ -174,10 +175,8 @@ void CWLPointerResource::sendLeave() {
// release all buttons unless we have a dnd going on in which case
// the events shall be lost.
if (!PROTO::data->dndActive()) {
timespec now;
clock_gettime(CLOCK_MONOTONIC, &now);
for (auto const& b : pressedButtons) {
sendButton(now.tv_sec * 1000 + now.tv_nsec / 1000000, b, WL_POINTER_BUTTON_STATE_RELEASED);
sendButton(Time::millis(Time::steadyNow()), b, WL_POINTER_BUTTON_STATE_RELEASED);
}
}