aboutsummaryrefslogtreecommitdiffstats
path: root/swaybar
diff options
context:
space:
mode:
authorLibravatar Simon Ser <contact@emersion.fr>2022-03-14 17:44:49 +0100
committerLibravatar Simon Zeni <simon@bl4ckb0ne.ca>2022-03-14 13:02:17 -0400
commit3dffe7f3a641848b246b7c543c0c3ec183823cdb (patch)
treec1cd13eafd28be6fd5cadfb0443bc8d02133f2c9 /swaybar
parentswaybar: remove swaybar_output.input_region (diff)
downloadsway-3dffe7f3a641848b246b7c543c0c3ec183823cdb.tar.gz
sway-3dffe7f3a641848b246b7c543c0c3ec183823cdb.tar.zst
sway-3dffe7f3a641848b246b7c543c0c3ec183823cdb.zip
swaybar: set opaque region
When the background color is fully opaque, set the surface's opaque region to the whole surface.
Diffstat (limited to 'swaybar')
-rw-r--r--swaybar/render.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/swaybar/render.c b/swaybar/render.c
index dcde6b9e..7e2f97b7 100644
--- a/swaybar/render.c
+++ b/swaybar/render.c
@@ -831,6 +831,15 @@ void render_frame(struct swaybar_output *output) {
831 wl_surface_damage(output->surface, 0, 0, 831 wl_surface_damage(output->surface, 0, 0,
832 output->width, output->height); 832 output->width, output->height);
833 833
834 uint32_t bg_alpha = ctx.background_color & 0xFF;
835 if (bg_alpha == 0xFF) {
836 struct wl_region *region =
837 wl_compositor_create_region(output->bar->compositor);
838 wl_region_add(region, 0, 0, INT32_MAX, INT32_MAX);
839 wl_surface_set_opaque_region(output->surface, region);
840 wl_region_destroy(region);
841 }
842
834 struct wl_callback *frame_callback = wl_surface_frame(output->surface); 843 struct wl_callback *frame_callback = wl_surface_frame(output->surface);
835 wl_callback_add_listener(frame_callback, &output_frame_listener, output); 844 wl_callback_add_listener(frame_callback, &output_frame_listener, output);
836 output->frame_scheduled = true; 845 output->frame_scheduled = true;