aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/layer_shell.c
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2018-03-29 16:51:36 -0400
committerLibravatar Drew DeVault <sir@cmpwn.com>2018-03-29 22:11:08 -0400
commit6836074fed83255438960fdc9597532d8bcae4bd (patch)
treeafc1f5292e934ef012800c6575f7fb8e0e303eee /sway/desktop/layer_shell.c
parentFixed laggy focused output boolean (diff)
downloadsway-6836074fed83255438960fdc9597532d8bcae4bd.tar.gz
sway-6836074fed83255438960fdc9597532d8bcae4bd.tar.zst
sway-6836074fed83255438960fdc9597532d8bcae4bd.zip
Implement enough IPC for swaybar to work
Diffstat (limited to 'sway/desktop/layer_shell.c')
-rw-r--r--sway/desktop/layer_shell.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c
index 31679fb2..187c8664 100644
--- a/sway/desktop/layer_shell.c
+++ b/sway/desktop/layer_shell.c
@@ -156,7 +156,6 @@ void arrange_layers(struct sway_output *output) {
156 struct wlr_box usable_area = { 0 }; 156 struct wlr_box usable_area = { 0 };
157 wlr_output_effective_resolution(output->wlr_output, 157 wlr_output_effective_resolution(output->wlr_output,
158 &usable_area.width, &usable_area.height); 158 &usable_area.width, &usable_area.height);
159 struct wlr_box usable_area_before = output->usable_area;
160 159
161 // Arrange exclusive surfaces from top->bottom 160 // Arrange exclusive surfaces from top->bottom
162 arrange_layer(output, &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY], 161 arrange_layer(output, &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY],
@@ -169,11 +168,7 @@ void arrange_layers(struct sway_output *output) {
169 &usable_area, true); 168 &usable_area, true);
170 memcpy(&output->usable_area, &usable_area, sizeof(struct wlr_box)); 169 memcpy(&output->usable_area, &usable_area, sizeof(struct wlr_box));
171 170
172 if (memcmp(&usable_area_before, 171 arrange_windows(output->swayc, -1, -1);
173 &usable_area, sizeof(struct wlr_box)) != 0) {
174 wlr_log(L_DEBUG, "arrange");
175 arrange_windows(output->swayc, -1, -1);
176 }
177 172
178 // Arrange non-exlusive surfaces from top->bottom 173 // Arrange non-exlusive surfaces from top->bottom
179 usable_area.x = usable_area.y = 0; 174 usable_area.x = usable_area.y = 0;
@@ -221,6 +216,7 @@ static void unmap(struct wlr_layer_surface *layer_surface) {
221static void handle_destroy(struct wl_listener *listener, void *data) { 216static void handle_destroy(struct wl_listener *listener, void *data) {
222 struct sway_layer_surface *sway_layer = wl_container_of( 217 struct sway_layer_surface *sway_layer = wl_container_of(
223 listener, sway_layer, destroy); 218 listener, sway_layer, destroy);
219 wlr_log(L_DEBUG, "layer surface removed");
224 if (sway_layer->layer_surface->mapped) { 220 if (sway_layer->layer_surface->mapped) {
225 unmap(sway_layer->layer_surface); 221 unmap(sway_layer->layer_surface);
226 } 222 }
@@ -233,8 +229,8 @@ static void handle_destroy(struct wl_listener *listener, void *data) {
233 wl_list_remove(&sway_layer->output_destroy.link); 229 wl_list_remove(&sway_layer->output_destroy.link);
234 } 230 }
235 struct sway_output *output = sway_layer->layer_surface->output->data; 231 struct sway_output *output = sway_layer->layer_surface->output->data;
236 arrange_layers(output);
237 free(sway_layer); 232 free(sway_layer);
233 arrange_layers(output);
238} 234}
239 235
240static void handle_map(struct wl_listener *listener, void *data) { 236static void handle_map(struct wl_listener *listener, void *data) {