diff options
Diffstat (limited to 'src/helpers/sync')
| -rw-r--r-- | src/helpers/sync/SyncTimeline.cpp | 4 | ||||
| -rw-r--r-- | src/helpers/sync/SyncTimeline.hpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/helpers/sync/SyncTimeline.cpp b/src/helpers/sync/SyncTimeline.cpp index 614a7c5b..9fe2e406 100644 --- a/src/helpers/sync/SyncTimeline.cpp +++ b/src/helpers/sync/SyncTimeline.cpp @@ -64,7 +64,7 @@ std::optional<bool> CSyncTimeline::check(uint64_t point, uint32_t flags) { return ret == 0; } -bool CSyncTimeline::addWaiter(const std::function<void()>& waiter, uint64_t point, uint32_t flags) { +bool CSyncTimeline::addWaiter(std::function<void()>&& waiter, uint64_t point, uint32_t flags) { auto eventFd = CFileDescriptor(eventfd(0, EFD_CLOEXEC)); if (!eventFd.isValid()) { @@ -77,7 +77,7 @@ bool CSyncTimeline::addWaiter(const std::function<void()>& waiter, uint64_t poin return false; } - g_pEventLoopManager->doOnReadable(std::move(eventFd), waiter); + g_pEventLoopManager->doOnReadable(std::move(eventFd), std::move(waiter)); return true; } diff --git a/src/helpers/sync/SyncTimeline.hpp b/src/helpers/sync/SyncTimeline.hpp index 37d5b301..5b5aa224 100644 --- a/src/helpers/sync/SyncTimeline.hpp +++ b/src/helpers/sync/SyncTimeline.hpp @@ -25,7 +25,7 @@ class CSyncTimeline { // std::nullopt on fail std::optional<bool> check(uint64_t point, uint32_t flags); - bool addWaiter(const std::function<void()>& waiter, uint64_t point, uint32_t flags); + bool addWaiter(std::function<void()>&& waiter, uint64_t point, uint32_t flags); Hyprutils::OS::CFileDescriptor exportAsSyncFileFD(uint64_t src); bool importFromSyncFileFD(uint64_t dst, Hyprutils::OS::CFileDescriptor& fd); bool transfer(SP<CSyncTimeline> from, uint64_t fromPoint, uint64_t toPoint); |
