mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-22 22:05:59 +01:00
presentation-feedback: fix invalid values sent after aq merge
This commit is contained in:
parent
e6fc9873b5
commit
3b6bcd6ddc
2 changed files with 10 additions and 2 deletions
|
@ -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;
|
||||
|
|
|
@ -463,7 +463,7 @@ void CWLSurfaceResource::presentFeedback(timespec* when, CMonitor* pMonitor, boo
|
|||
frame(when);
|
||||
auto FEEDBACK = makeShared<CQueuedPresentationData>(self.lock());
|
||||
FEEDBACK->attachMonitor(pMonitor);
|
||||
FEEDBACK->discarded();
|
||||
FEEDBACK->presented();
|
||||
PROTO::presentation->queueData(FEEDBACK);
|
||||
|
||||
if (!pMonitor || !pMonitor->outTimeline || !syncobj || !needsExplicitSync)
|
||||
|
|
Loading…
Reference in a new issue