diff options
author | Simon Ser <contact@emersion.fr> | 2022-03-14 17:48:39 +0100 |
---|---|---|
committer | Simon Zeni <simon@bl4ckb0ne.ca> | 2022-03-14 13:01:29 -0400 |
commit | dd8b6f5e68b0a4c1251fc9fdec30aa145b75636f (patch) | |
tree | 3d42ddb6774edbd2ee12500895f99946fadb063d | |
parent | Replace pcre with pcre2 (diff) | |
download | sway-dd8b6f5e68b0a4c1251fc9fdec30aa145b75636f.tar.gz sway-dd8b6f5e68b0a4c1251fc9fdec30aa145b75636f.tar.zst sway-dd8b6f5e68b0a4c1251fc9fdec30aa145b75636f.zip |
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.
-rw-r--r-- | include/swaybar/bar.h | 1 | ||||
-rw-r--r-- | swaybar/bar.c | 10 |
2 files changed, 3 insertions, 8 deletions
diff --git a/include/swaybar/bar.h b/include/swaybar/bar.h index 545a66a8..3ad0bdf3 100644 --- a/include/swaybar/bar.h +++ b/include/swaybar/bar.h | |||
@@ -58,7 +58,6 @@ struct swaybar_output { | |||
58 | struct zxdg_output_v1 *xdg_output; | 58 | struct zxdg_output_v1 *xdg_output; |
59 | struct wl_surface *surface; | 59 | struct wl_surface *surface; |
60 | struct zwlr_layer_surface_v1 *layer_surface; | 60 | struct zwlr_layer_surface_v1 *layer_surface; |
61 | struct wl_region *input_region; | ||
62 | uint32_t wl_name; | 61 | uint32_t wl_name; |
63 | 62 | ||
64 | struct wl_list workspaces; // swaybar_workspace::link | 63 | struct wl_list workspaces; // swaybar_workspace::link |
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) { | |||
51 | if (output->surface != NULL) { | 51 | if (output->surface != NULL) { |
52 | wl_surface_destroy(output->surface); | 52 | wl_surface_destroy(output->surface); |
53 | } | 53 | } |
54 | if (output->input_region != NULL) { | ||
55 | wl_region_destroy(output->input_region); | ||
56 | } | ||
57 | wl_output_destroy(output->output); | 54 | wl_output_destroy(output->output); |
58 | destroy_buffer(&output->buffers[0]); | 55 | destroy_buffer(&output->buffers[0]); |
59 | destroy_buffer(&output->buffers[1]); | 56 | destroy_buffer(&output->buffers[1]); |
@@ -113,10 +110,9 @@ static void add_layer_surface(struct swaybar_output *output) { | |||
113 | 110 | ||
114 | if (overlay) { | 111 | if (overlay) { |
115 | // Empty input region | 112 | // Empty input region |
116 | output->input_region = wl_compositor_create_region(bar->compositor); | 113 | struct wl_region *region = wl_compositor_create_region(bar->compositor); |
117 | assert(output->input_region); | 114 | wl_surface_set_input_region(output->surface, region); |
118 | 115 | wl_region_destroy(region); | |
119 | wl_surface_set_input_region(output->surface, output->input_region); | ||
120 | } | 116 | } |
121 | 117 | ||
122 | zwlr_layer_surface_v1_set_anchor(output->layer_surface, config->position); | 118 | zwlr_layer_surface_v1_set_anchor(output->layer_surface, config->position); |