From 0de35b3585f32951a7a7e6c2b1d8673b78cccefd Mon Sep 17 00:00:00 2001 From: Alexander Orzechowski Date: Sun, 29 Sep 2024 16:50:00 -0400 Subject: [PATCH] Fix alpha-modifier-v1 (cherry picked from commit 9a9be01ad4130e4e19b437fd064f90982974971f) --- sway/desktop/output.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sway/desktop/output.c b/sway/desktop/output.c index 0a19ad57..35a61bd0 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -216,6 +217,15 @@ static void output_configure_scene(struct sway_output *output, if (node->type == WLR_SCENE_NODE_BUFFER) { struct wlr_scene_buffer *buffer = wlr_scene_buffer_from_node(node); + struct wlr_scene_surface *surface = wlr_scene_surface_try_from_buffer(buffer); + + if (surface) { + const struct wlr_alpha_modifier_surface_v1_state *alpha_modifier_state = + wlr_alpha_modifier_v1_get_surface_state(surface->surface); + if (alpha_modifier_state != NULL) { + opacity *= (float)alpha_modifier_state->multiplier; + } + } // hack: don't call the scene setter because that will damage all outputs // We don't want to damage outputs that aren't our current output that