commit 30434b2beb0c621015452775011426da8d5e4705
parent 3a49409dae9b8d579a4b92370ff5ba4a48cb5156
Author: Kenny Levinsen <kl@kl.wtf>
Date: Wed, 19 Mar 2025 00:15:01 +0100
desktop/output: Skip repaint if wlr_output is disabled
When the repaint timer fires, we check if the sway_output is disabled,
and if so, skip the output commit after having reset frame_pending.
The sway_output enable flag is only updated if the output is disabled
and removed from the layout, not if the power is disabled for e.g. idle.
This can lead to situations where a commit is attempted on a disabled
output, which will lead to an attempted and failed primary swapchain
allocation.
Use the wlr_output.enabled state to check if the output is active.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sway/desktop/output.c b/sway/desktop/output.c
@@ -264,7 +264,7 @@ static int output_repaint_timer_handler(void *data) {
struct sway_output *output = data;
output->wlr_output->frame_pending = false;
- if (!output->enabled) {
+ if (!output->wlr_output->enabled) {
return 0;
}