diff options
| author | Vaxry <vaxry@vaxry.net> | 2024-07-21 19:25:01 +0200 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2024-07-21 19:25:07 +0200 |
| commit | 3b6bcd6ddcfebd1fed0694aa2c0bd9753f4d5d46 (patch) | |
| tree | 22f1bf03a7619e88bca3cc797731146c035cf1ba /src/protocols/PresentationTime.cpp | |
| parent | e6fc9873b5e10e7ac00085da7d599776ed72f297 (diff) | |
presentation-feedback: fix invalid values sent after aq merge
Diffstat (limited to 'src/protocols/PresentationTime.cpp')
| -rw-r--r-- | src/protocols/PresentationTime.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/protocols/PresentationTime.cpp b/src/protocols/PresentationTime.cpp index e9472fc3..a2fc270c 100644 --- a/src/protocols/PresentationTime.cpp +++ b/src/protocols/PresentationTime.cpp @@ -60,7 +60,7 @@ void CPresentationFeedback::sendQueued(SP<CQueuedPresentationData> data, timespe if (reportedFlags & Aquamarine::IOutput::AQ_OUTPUT_PRESENT_HW_COMPLETION) flags |= WP_PRESENTATION_FEEDBACK_KIND_HW_COMPLETION; - if (data->wasPresented && when) + if (data->wasPresented) resource->sendPresented((uint32_t)(when->tv_sec >> 32), (uint32_t)(when->tv_sec & 0xFFFFFFFF), (uint32_t)(when->tv_nsec), untilRefreshNs, (uint32_t)(seq >> 32), (uint32_t)(seq & 0xFFFFFFFF), (wpPresentationFeedbackKind)flags); else @@ -104,6 +104,14 @@ void CPresentationProtocol::onGetFeedback(CWpPresentation* pMgr, wl_resource* su } void CPresentationProtocol::onPresented(CMonitor* pMonitor, timespec* when, uint32_t untilRefreshNs, uint64_t seq, uint32_t reportedFlags) { + timespec now; + timespec* presentedAt = when; + if (!presentedAt) { + // just put the current time, we don't have anything better + clock_gettime(CLOCK_MONOTONIC, &now); + when = &now; + } + for (auto& feedback : m_vFeedbacks) { if (!feedback->surface) continue; |
