Skip to content

Commit 0de35b3

Browse files
Nefsen402emersion
authored andcommitted
Fix alpha-modifier-v1
(cherry picked from commit 9a9be01)
1 parent 703671a commit 0de35b3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

sway/desktop/output.c

+10
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <wlr/render/swapchain.h>
99
#include <wlr/render/wlr_renderer.h>
1010
#include <wlr/types/wlr_buffer.h>
11+
#include <wlr/types/wlr_alpha_modifier_v1.h>
1112
#include <wlr/types/wlr_gamma_control_v1.h>
1213
#include <wlr/types/wlr_matrix.h>
1314
#include <wlr/types/wlr_output_layout.h>
@@ -216,6 +217,15 @@ static void output_configure_scene(struct sway_output *output,
216217

217218
if (node->type == WLR_SCENE_NODE_BUFFER) {
218219
struct wlr_scene_buffer *buffer = wlr_scene_buffer_from_node(node);
220+
struct wlr_scene_surface *surface = wlr_scene_surface_try_from_buffer(buffer);
221+
222+
if (surface) {
223+
const struct wlr_alpha_modifier_surface_v1_state *alpha_modifier_state =
224+
wlr_alpha_modifier_v1_get_surface_state(surface->surface);
225+
if (alpha_modifier_state != NULL) {
226+
opacity *= (float)alpha_modifier_state->multiplier;
227+
}
228+
}
219229

220230
// hack: don't call the scene setter because that will damage all outputs
221231
// We don't want to damage outputs that aren't our current output that

0 commit comments

Comments
 (0)