From: Consolatis <35009135+Consolatis@users.noreply.github.com> Date: Thu, 13 Feb 2025 15:28:17 +0000 (+0100) Subject: output: early return on wlopm if requested state is already set X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=bf0259809860dc2cb7580b6d90d60ce12e31f7e8;p=proto%2Flabwc.git output: early return on wlopm if requested state is already set This prevents a unnecessary output commit without buffer, showing up as black flash when repeatedly calling wlopm --on. --- diff --git a/src/output.c b/src/output.c index 8a5b5825..2d805b10 100644 --- a/src/output.c +++ b/src/output.c @@ -1068,10 +1068,16 @@ handle_output_power_manager_set_mode(struct wl_listener *listener, void *data) switch (event->mode) { case ZWLR_OUTPUT_POWER_V1_MODE_OFF: + if (!event->output->enabled) { + return; + } wlr_output_state_set_enabled(&output->pending, false); output_state_commit(output); break; case ZWLR_OUTPUT_POWER_V1_MODE_ON: + if (event->output->enabled) { + return; + } wlr_output_state_set_enabled(&output->pending, true); if (!event->output->current_mode) { /*