From 834ee3dfd40fc2332aa67e06f3de14b394320cc6 Mon Sep 17 00:00:00 2001 From: Johan Malm Date: Tue, 15 Mar 2022 21:30:25 +0000 Subject: [PATCH] output: fix incorrect call to private wlroots function Use wlr_output_test() instead of output_ensure_buffer() which is not a public function and only compiled when linking statically to wlroots. Also wlr_output_rollback() on failed test. Fixes issue #273 Backport of https://github.com/labwc/labwc/commit/5fd5024ca655d07d04cfb3e9c829c1764dd8ee01 --- src/output.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/output.c b/src/output.c index 3267d38f..0e28b058 100644 --- a/src/output.c +++ b/src/output.c @@ -9,6 +9,7 @@ #define _POSIX_C_SOURCE 200809L #include "config.h" #include +#include #include #include #include @@ -1299,7 +1300,9 @@ handle_output_power_manager_set_mode(struct wl_listener *listener, void *data) break; case ZWLR_OUTPUT_POWER_V1_MODE_ON: wlr_output_enable(event->output, true); - output_ensure_buffer(event->output); + if (!wlr_output_test(event->output)) { + wlr_output_rollback(event->output); + } wlr_output_commit(event->output); break; }