summaryrefslogtreecommitdiff
path: root/src/config
diff options
context:
space:
mode:
authorvaxerski <vaxry@vaxry.net>2023-08-11 17:37:52 +0200
committervaxerski <vaxry@vaxry.net>2023-08-11 17:37:57 +0200
commit3f7f4207a6dd8bd217c01514ea40e9e4b9b7874a (patch)
tree346ac60f6dd5b1cb291d0d7e7989c1cb03f6ee2f /src/config
parent8a7ce59ad405adee5d701b6a5be67dd45b5a24bd (diff)
config: add vrr per-display
Diffstat (limited to 'src/config')
-rw-r--r--src/config/ConfigManager.cpp11
-rw-r--r--src/config/ConfigManager.hpp14
2 files changed, 9 insertions, 16 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp
index cf2f8ed6..bb582039 100644
--- a/src/config/ConfigManager.cpp
+++ b/src/config/ConfigManager.cpp
@@ -660,6 +660,9 @@ void CConfigManager::handleMonitor(const std::string& command, const std::string
} else if (ARGS[argno] == "transform") {
newrule.transform = (wl_output_transform)std::stoi(ARGS[argno + 1]);
argno++;
+ } else if (ARGS[argno] == "vrr") {
+ newrule.vrr = std::stoi(ARGS[argno + 1]);
+ argno++;
} else if (ARGS[argno] == "workspace") {
std::string name = "";
int wsId = getWorkspaceIDFromString(ARGS[argno + 1], name);
@@ -2070,7 +2073,9 @@ void CConfigManager::ensureVRR(CMonitor* pMonitor) {
if (!m->output)
return;
- if (*PVRR == 0) {
+ const auto USEVRR = m->activeMonitorRule.vrr.has_value() ? m->activeMonitorRule.vrr.value() : *PVRR;
+
+ if (USEVRR == 0) {
if (m->vrrActive) {
wlr_output_enable_adaptive_sync(m->output, 0);
@@ -2080,7 +2085,7 @@ void CConfigManager::ensureVRR(CMonitor* pMonitor) {
}
m->vrrActive = false;
return;
- } else if (*PVRR == 1) {
+ } else if (USEVRR == 1) {
if (!m->vrrActive) {
wlr_output_enable_adaptive_sync(m->output, 1);
@@ -2095,7 +2100,7 @@ void CConfigManager::ensureVRR(CMonitor* pMonitor) {
}
m->vrrActive = true;
return;
- } else if (*PVRR == 2) {
+ } else if (USEVRR == 2) {
/* fullscreen */
m->vrrActive = true;
diff --git a/src/config/ConfigManager.hpp b/src/config/ConfigManager.hpp
index d5cd77db..b2b9c38c 100644
--- a/src/config/ConfigManager.hpp
+++ b/src/config/ConfigManager.hpp
@@ -14,6 +14,7 @@
#include <xf86drmMode.h>
#include "../Window.hpp"
#include "../helpers/WLClasses.hpp"
+#include "../helpers/Monitor.hpp"
#include "defaultConfig.hpp"
#include "ConfigDataValues.hpp"
@@ -35,19 +36,6 @@ struct SConfigValue {
bool set = false; // used for device configs
};
-struct SMonitorRule {
- std::string name = "";
- Vector2D resolution = Vector2D(1280, 720);
- Vector2D offset = Vector2D(0, 0);
- float scale = 1;
- float refreshRate = 60;
- bool disabled = false;
- wl_output_transform transform = WL_OUTPUT_TRANSFORM_NORMAL;
- std::string mirrorOf = "";
- bool enable10bit = false;
- drmModeModeInfo drmMode = {};
-};
-
struct SWorkspaceRule {
std::string monitor = "";
std::string workspaceString = "";