aboutsummaryrefslogtreecommitdiff
path: root/swaybar
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2022-03-14 17:48:39 +0100
committerFurkan Sahin <furkan-dev@proton.me>2022-03-14 17:48:39 +0100
commit878d4ce0f04b54611b14b9b593bf1cc6e5b6efab (patch)
tree3d42ddb6774edbd2ee12500895f99946fadb063d /swaybar
parent17f17aef14de055fec3d2ea70671effc17874326 (diff)
swaybar: remove swaybar_output.input_region
No need to keep the region around, we can immediately destroy it after the wl_surface.set_input_region request.
Diffstat (limited to 'swaybar')
-rw-r--r--swaybar/bar.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/swaybar/bar.c b/swaybar/bar.c
index 6ffdc9b4..5e4ebd97 100644
--- a/swaybar/bar.c
+++ b/swaybar/bar.c
@@ -51,9 +51,6 @@ static void swaybar_output_free(struct swaybar_output *output) {
if (output->surface != NULL) {
wl_surface_destroy(output->surface);
}
- if (output->input_region != NULL) {
- wl_region_destroy(output->input_region);
- }
wl_output_destroy(output->output);
destroy_buffer(&output->buffers[0]);
destroy_buffer(&output->buffers[1]);
@@ -113,10 +110,9 @@ static void add_layer_surface(struct swaybar_output *output) {
if (overlay) {
// Empty input region
- output->input_region = wl_compositor_create_region(bar->compositor);
- assert(output->input_region);
-
- wl_surface_set_input_region(output->surface, output->input_region);
+ struct wl_region *region = wl_compositor_create_region(bar->compositor);
+ wl_surface_set_input_region(output->surface, region);
+ wl_region_destroy(region);
}
zwlr_layer_surface_v1_set_anchor(output->layer_surface, config->position);