1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
|
From b987564082c07c93402c8ad8978172bafa94fb7b Mon Sep 17 00:00:00 2001
From: Scott Moreau <oreaus@gmail.com>
Date: Sat, 28 Sep 2024 09:47:14 -0600
Subject: [PATCH 29/34] output-layout: Reset wlr_output_state after each commit
---
src/core/output-layout.cpp | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/src/core/output-layout.cpp b/src/core/output-layout.cpp
index a6dde8f4..dcaf23f5 100644
--- a/src/core/output-layout.cpp
+++ b/src/core/output-layout.cpp
@@ -621,6 +621,8 @@ struct output_layout_output_t
{
/* Commit the enabling of the output */
wlr_output_commit_state(handle, &state);
+ wlr_output_state_finish(&state);
+ wlr_output_state_init(&state);
return;
}
@@ -642,6 +644,8 @@ struct output_layout_output_t
}
wlr_output_commit_state(handle, &state);
+ wlr_output_state_finish(&state);
+ wlr_output_state_init(&state);
const bool adaptive_sync_enabled = (handle->adaptive_sync_status == WLR_OUTPUT_ADAPTIVE_SYNC_ENABLED);
@@ -655,10 +659,12 @@ struct output_layout_output_t
} else
{
LOGE("Failed to change adaptive sync on output: ", handle->name);
- wlr_output_state_set_adaptive_sync_enabled(&state, adaptive_sync_enabled);
}
}
+ wlr_output_state_finish(&state);
+ wlr_output_state_init(&state);
+
if (current_state.depth != current_bit_depth)
{
for (auto fmt : formats_for_depth[current_state.depth])
@@ -666,6 +672,7 @@ struct output_layout_output_t
wlr_output_state_set_render_format(&state, fmt);
if (wlr_output_test_state(handle, &state))
{
+ wlr_output_state_set_render_format(&state, fmt);
wlr_output_commit_state(handle, &state);
current_bit_depth = current_state.depth;
LOGD("Set output format to ", get_format_name(fmt), " on output ", handle->name);
@@ -675,6 +682,9 @@ struct output_layout_output_t
LOGD("Failed to set output format ", get_format_name(fmt), " on output ", handle->name);
}
}
+
+ wlr_output_state_finish(&state);
+ wlr_output_state_init(&state);
}
/* Mirroring implementation */
@@ -697,6 +707,8 @@ struct output_layout_output_t
wlr_render_pass_submit(pass);
wlr_output_commit_state(handle, &state);
+ wlr_output_state_finish(&state);
+ wlr_output_state_init(&state);
}
/* Load output contents and render them */
@@ -737,6 +749,8 @@ struct output_layout_output_t
if (!enabled)
{
wlr_output_commit_state(handle, &state);
+ wlr_output_state_finish(&state);
+ wlr_output_state_init(&state);
}
}
@@ -917,6 +931,8 @@ struct output_layout_output_t
}
wlr_output_commit_state(handle, &this->state);
+ wlr_output_state_finish(&this->state);
+ wlr_output_state_init(&this->state);
ensure_wayfire_output(get_effective_size());
output->render->damage_whole();
--
2.45.2
|