input: Fix VRR for constrained cursors (#6877)
This commit is contained in:
parent
f5db483973
commit
ee8116ac5d
12 changed files with 100 additions and 17 deletions
|
|
@ -16,6 +16,7 @@
|
|||
#include "../protocols/core/Compositor.hpp"
|
||||
#include "sync/SyncTimeline.hpp"
|
||||
#include <aquamarine/output/Output.hpp>
|
||||
#include "debug/Log.hpp"
|
||||
#include <hyprutils/string/String.hpp>
|
||||
#include <hyprutils/utils/ScopeGuard.hpp>
|
||||
using namespace Hyprutils::String;
|
||||
|
|
@ -384,7 +385,7 @@ bool CMonitor::shouldSkipScheduleFrameOnMouseEvent() {
|
|||
*PNOBREAK && output->state->state().adaptiveSync && activeWorkspace && activeWorkspace->m_bHasFullscreenWindow && activeWorkspace->m_efFullscreenMode == FSMODE_FULLSCREEN;
|
||||
|
||||
// keep requested minimum refresh rate
|
||||
if (shouldSkip && *PMINRR && lastPresentationTimer.getMillis() > 1000 / *PMINRR) {
|
||||
if (shouldSkip && *PMINRR && lastPresentationTimer.getMillis() > 1000.0f / *PMINRR) {
|
||||
// damage whole screen because some previous cursor box damages were skipped
|
||||
damage.damageEntire();
|
||||
return false;
|
||||
|
|
@ -933,6 +934,11 @@ bool CMonitor::attemptDirectScanout() {
|
|||
return true;
|
||||
}
|
||||
|
||||
void CMonitor::debugLastPresentation(const std::string& message) {
|
||||
Debug::log(TRACE, "{} (last presentation {} - {} fps)", message, lastPresentationTimer.getMillis(),
|
||||
lastPresentationTimer.getMillis() > 0 ? 1000.0f / lastPresentationTimer.getMillis() : 0.0f);
|
||||
}
|
||||
|
||||
CMonitorState::CMonitorState(CMonitor* owner) {
|
||||
m_pOwner = owner;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -185,6 +185,8 @@ class CMonitor {
|
|||
bool attemptDirectScanout();
|
||||
void setCTM(const Mat3x3& ctm);
|
||||
|
||||
void debugLastPresentation(const std::string& message);
|
||||
|
||||
bool m_bEnabled = false;
|
||||
bool m_bRenderingInitPassed = false;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#include "Timer.hpp"
|
||||
#include <chrono>
|
||||
|
||||
void CTimer::reset() {
|
||||
m_tpLastReset = std::chrono::steady_clock::now();
|
||||
|
|
@ -8,8 +9,8 @@ std::chrono::steady_clock::duration CTimer::getDuration() {
|
|||
return std::chrono::steady_clock::now() - m_tpLastReset;
|
||||
}
|
||||
|
||||
long CTimer::getMillis() {
|
||||
return std::chrono::duration_cast<std::chrono::milliseconds>(getDuration()).count();
|
||||
float CTimer::getMillis() {
|
||||
return std::chrono::duration_cast<std::chrono::microseconds>(getDuration()).count() / 1000.f;
|
||||
}
|
||||
|
||||
float CTimer::getSeconds() {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ class CTimer {
|
|||
public:
|
||||
void reset();
|
||||
float getSeconds();
|
||||
long getMillis();
|
||||
float getMillis();
|
||||
const std::chrono::steady_clock::time_point& chrono() const;
|
||||
|
||||
private:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue