summaryrefslogtreecommitdiff
path: root/src/render/Renderer.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-05-06 17:18:24 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-05-06 17:18:24 +0200
commit034192650f8194a8720e88070a7287b3f0523ba4 (patch)
treebbd51aa81f91c4383d5077e9ede249269356eed8 /src/render/Renderer.cpp
parentff86f723b227b3f526904d422964322b3cbb4d7a (diff)
respect outputMgrApplyTest
Diffstat (limited to 'src/render/Renderer.cpp')
-rw-r--r--src/render/Renderer.cpp39
1 files changed, 23 insertions, 16 deletions
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index 6f59c045..f65a4be2 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -196,32 +196,39 @@ void CHyprRenderer::outputMgrApplyTest(wlr_output_configuration_v1* config, bool
bool noError = true;
wl_list_for_each(head, &config->heads, link) {
+
+ std::string commandForCfg = "";
const auto OUTPUT = head->state.output;
- wlr_output_enable(OUTPUT, head->state.enabled);
- if (head->state.enabled) {
- if (head->state.mode)
- wlr_output_set_mode(OUTPUT, head->state.mode);
- else
- wlr_output_set_custom_mode(OUTPUT, head->state.custom_mode.width, head->state.custom_mode.height, head->state.custom_mode.refresh);
-
- wlr_output_layout_move(g_pCompositor->m_sWLROutputLayout, OUTPUT, head->state.x, head->state.y);
- wlr_output_set_transform(OUTPUT, head->state.transform);
- wlr_output_set_scale(OUTPUT, head->state.scale);
+ commandForCfg += std::string(OUTPUT->name) + ",";
+
+ if (!head->state.enabled) {
+ commandForCfg += "disabled";
+ if (!test)
+ g_pConfigManager->parseKeyword("monitor", commandForCfg, true);
+ continue;
}
+ wlr_output_enable(OUTPUT, head->state.enabled);
+
+ if (head->state.mode)
+ commandForCfg += std::to_string(head->state.mode->width) + "x" + std::to_string(head->state.mode->height) + "@" + std::to_string(head->state.mode->refresh / 1000.f) + ",";
+ else
+ commandForCfg += std::to_string(head->state.custom_mode.width) + "x" + std::to_string(head->state.custom_mode.height) + "@" + std::to_string(head->state.custom_mode.refresh / 1000.f) + ",";
+
+ commandForCfg += std::to_string(head->state.x) + "x" + std::to_string(head->state.y) + "," + std::to_string(head->state.scale);
+
+ if (!test)
+ g_pConfigManager->parseKeyword("monitor", commandForCfg, true);
+
noError = wlr_output_test(OUTPUT);
if (!noError)
break;
}
- wl_list_for_each(head, &config->heads, link) {
- if (noError && !test)
- wlr_output_commit(head->state.output);
- else
- wlr_output_rollback(head->state.output);
- }
+ if (!test)
+ g_pConfigManager->m_bWantsMonitorReload = true; // for monitor keywords
if (noError)
wlr_output_configuration_v1_send_succeeded(config);