aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorscorpion-26 <[email protected]>2023-02-16 23:20:10 +0100
committerGitHub <[email protected]>2023-02-16 22:20:10 +0000
commitf3d1ab55a2a804968b92641452875ba1f0b9dd71 (patch)
tree841c252415e3d45eeaadbc7e6d08850a89f57842
parentff95721ad9dd51f51f84305746bb47593b9f4f76 (diff)
downloadHyprland-f3d1ab55a2a804968b92641452875ba1f0b9dd71.tar.gz
Hyprland-f3d1ab55a2a804968b92641452875ba1f0b9dd71.zip
Add vrr to hyprctl monitor (#1560)
Since the (re)addition of vrr in 127e80692f78b0d91450194fcb4ce0009c2a98a4, it is very useful to know, whether a given monitor has vrr enabled or not, since not all monitors support it. Now hyprctl reports, whether a monitor has vrr enabled or not.
-rw-r--r--src/debug/HyprCtl.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp
index be5cccb9..3366cb33 100644
--- a/src/debug/HyprCtl.cpp
+++ b/src/debug/HyprCtl.cpp
@@ -41,14 +41,15 @@ std::string monitorsRequest(HyprCtl::eHyprCtlOutputFormat format) {
"scale": %.2f,
"transform": %i,
"focused": %s,
- "dpmsStatus": %s
+ "dpmsStatus": %s,
+ "vrr: %s"
},)#",
m->ID, escapeJSONStrings(m->szName).c_str(), escapeJSONStrings(m->output->description ? m->output->description : "").c_str(),
(m->output->make ? m->output->make : ""), (m->output->model ? m->output->model : ""), (m->output->serial ? m->output->serial : ""), (int)m->vecPixelSize.x,
(int)m->vecPixelSize.y, m->refreshRate, (int)m->vecPosition.x, (int)m->vecPosition.y, m->activeWorkspace,
escapeJSONStrings(g_pCompositor->getWorkspaceByID(m->activeWorkspace)->m_szName).c_str(), (int)m->vecReservedTopLeft.x, (int)m->vecReservedTopLeft.y,
(int)m->vecReservedBottomRight.x, (int)m->vecReservedBottomRight.y, m->scale, (int)m->transform, (m.get() == g_pCompositor->m_pLastMonitor ? "true" : "false"),
- (m->dpmsStatus ? "true" : "false"));
+ (m->dpmsStatus ? "true" : "false"), (m->output->adaptive_sync_status == WLR_OUTPUT_ADAPTIVE_SYNC_ENABLED ? "true" : "false"));
}
// remove trailing comma
@@ -59,12 +60,13 @@ std::string monitorsRequest(HyprCtl::eHyprCtlOutputFormat format) {
for (auto& m : g_pCompositor->m_vMonitors) {
result += getFormat("Monitor %s (ID %i):\n\t%ix%i@%f at %ix%i\n\tdescription: %s\n\tmake: %s\n\tmodel: %s\n\tserial: %s\n\tactive workspace: %i (%s)\n\treserved: %i "
"%i %i %i\n\tscale: %.2f\n\ttransform: "
- "%i\n\tfocused: %s\n\tdpmsStatus: %i\n\n",
+ "%i\n\tfocused: %s\n\tdpmsStatus: %i\n\tvrr: %i\n\n",
m->szName.c_str(), m->ID, (int)m->vecPixelSize.x, (int)m->vecPixelSize.y, m->refreshRate, (int)m->vecPosition.x, (int)m->vecPosition.y,
(m->output->description ? m->output->description : ""), (m->output->make ? m->output->make : ""), (m->output->model ? m->output->model : ""),
(m->output->serial ? m->output->serial : ""), m->activeWorkspace, g_pCompositor->getWorkspaceByID(m->activeWorkspace)->m_szName.c_str(),
(int)m->vecReservedTopLeft.x, (int)m->vecReservedTopLeft.y, (int)m->vecReservedBottomRight.x, (int)m->vecReservedBottomRight.y, m->scale,
- (int)m->transform, (m.get() == g_pCompositor->m_pLastMonitor ? "yes" : "no"), (int)m->dpmsStatus);
+ (int)m->transform, (m.get() == g_pCompositor->m_pLastMonitor ? "yes" : "no"),
+ (int)m->dpmsStatus, (int)(m->output->adaptive_sync_status == WLR_OUTPUT_ADAPTIVE_SYNC_ENABLED));
}
}