aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/layer_shell.c
diff options
context:
space:
mode:
authorLibravatar emersion <contact@emersion.fr>2018-09-14 19:21:44 +0200
committerLibravatar emersion <contact@emersion.fr>2018-09-14 19:21:44 +0200
commit7699c5444c32289a22ce2c57d1daadabed87e7ac (patch)
tree74696e6dd2f405e8629061ee010e14e3d6cf0b37 /sway/desktop/layer_shell.c
parentMerge pull request #2628 from RyanDwyer/remove-rejigger-assertion (diff)
downloadsway-7699c5444c32289a22ce2c57d1daadabed87e7ac.tar.gz
sway-7699c5444c32289a22ce2c57d1daadabed87e7ac.tar.zst
sway-7699c5444c32289a22ce2c57d1daadabed87e7ac.zip
Update for swaywm/wlroots#1243
Diffstat (limited to 'sway/desktop/layer_shell.c')
-rw-r--r--sway/desktop/layer_shell.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c
index 076bacc4..e09282b2 100644
--- a/sway/desktop/layer_shell.c
+++ b/sway/desktop/layer_shell.c
@@ -3,7 +3,7 @@
3#include <string.h> 3#include <string.h>
4#include <wayland-server.h> 4#include <wayland-server.h>
5#include <wlr/types/wlr_box.h> 5#include <wlr/types/wlr_box.h>
6#include <wlr/types/wlr_layer_shell.h> 6#include <wlr/types/wlr_layer_shell_v1.h>
7#include <wlr/types/wlr_output_damage.h> 7#include <wlr/types/wlr_output_damage.h>
8#include <wlr/types/wlr_output.h> 8#include <wlr/types/wlr_output.h>
9#include <wlr/util/log.h> 9#include <wlr/util/log.h>
@@ -86,8 +86,8 @@ static void arrange_layer(struct sway_output *output, struct wl_list *list,
86 wlr_output_effective_resolution(output->wlr_output, 86 wlr_output_effective_resolution(output->wlr_output,
87 &full_area.width, &full_area.height); 87 &full_area.width, &full_area.height);
88 wl_list_for_each(sway_layer, list, link) { 88 wl_list_for_each(sway_layer, list, link) {
89 struct wlr_layer_surface *layer = sway_layer->layer_surface; 89 struct wlr_layer_surface_v1 *layer = sway_layer->layer_surface;
90 struct wlr_layer_surface_state *state = &layer->current; 90 struct wlr_layer_surface_v1_state *state = &layer->current;
91 if (exclusive != (state->exclusive_zone > 0)) { 91 if (exclusive != (state->exclusive_zone > 0)) {
92 continue; 92 continue;
93 } 93 }
@@ -146,7 +146,7 @@ static void arrange_layer(struct sway_output *output, struct wl_list *list,
146 } 146 }
147 if (box.width < 0 || box.height < 0) { 147 if (box.width < 0 || box.height < 0) {
148 // TODO: Bubble up a protocol error? 148 // TODO: Bubble up a protocol error?
149 wlr_layer_surface_close(layer); 149 wlr_layer_surface_v1_close(layer);
150 continue; 150 continue;
151 } 151 }
152 // Apply 152 // Apply
@@ -154,7 +154,7 @@ static void arrange_layer(struct sway_output *output, struct wl_list *list,
154 apply_exclusive(usable_area, state->anchor, state->exclusive_zone, 154 apply_exclusive(usable_area, state->anchor, state->exclusive_zone,
155 state->margin.top, state->margin.right, 155 state->margin.top, state->margin.right,
156 state->margin.bottom, state->margin.left); 156 state->margin.bottom, state->margin.left);
157 wlr_layer_surface_configure(layer, box.width, box.height); 157 wlr_layer_surface_v1_configure(layer, box.width, box.height);
158 } 158 }
159} 159}
160 160
@@ -223,13 +223,13 @@ static void handle_output_destroy(struct wl_listener *listener, void *data) {
223 wl_list_remove(&sway_layer->link); 223 wl_list_remove(&sway_layer->link);
224 wl_list_init(&sway_layer->link); 224 wl_list_init(&sway_layer->link);
225 sway_layer->layer_surface->output = NULL; 225 sway_layer->layer_surface->output = NULL;
226 wlr_layer_surface_close(sway_layer->layer_surface); 226 wlr_layer_surface_v1_close(sway_layer->layer_surface);
227} 227}
228 228
229static void handle_surface_commit(struct wl_listener *listener, void *data) { 229static void handle_surface_commit(struct wl_listener *listener, void *data) {
230 struct sway_layer_surface *layer = 230 struct sway_layer_surface *layer =
231 wl_container_of(listener, layer, surface_commit); 231 wl_container_of(listener, layer, surface_commit);
232 struct wlr_layer_surface *layer_surface = layer->layer_surface; 232 struct wlr_layer_surface_v1 *layer_surface = layer->layer_surface;
233 struct wlr_output *wlr_output = layer_surface->output; 233 struct wlr_output *wlr_output = layer_surface->output;
234 if (wlr_output == NULL) { 234 if (wlr_output == NULL) {
235 return; 235 return;
@@ -312,13 +312,13 @@ static void handle_unmap(struct wl_listener *listener, void *data) {
312 unmap(sway_layer); 312 unmap(sway_layer);
313} 313}
314 314
315struct sway_layer_surface *layer_from_wlr_layer_surface( 315struct sway_layer_surface *layer_from_wlr_layer_surface_v1(
316 struct wlr_layer_surface *layer_surface) { 316 struct wlr_layer_surface_v1 *layer_surface) {
317 return layer_surface->data; 317 return layer_surface->data;
318} 318}
319 319
320void handle_layer_shell_surface(struct wl_listener *listener, void *data) { 320void handle_layer_shell_surface(struct wl_listener *listener, void *data) {
321 struct wlr_layer_surface *layer_surface = data; 321 struct wlr_layer_surface_v1 *layer_surface = data;
322 struct sway_server *server = 322 struct sway_server *server =
323 wl_container_of(listener, server, layer_shell_surface); 323 wl_container_of(listener, server, layer_shell_surface);
324 wlr_log(WLR_DEBUG, "new layer surface: namespace %s layer %d anchor %d " 324 wlr_log(WLR_DEBUG, "new layer surface: namespace %s layer %d anchor %d "
@@ -345,7 +345,7 @@ void handle_layer_shell_surface(struct wl_listener *listener, void *data) {
345 if (!output) { 345 if (!output) {
346 if (!sway_assert(root->outputs->length, 346 if (!sway_assert(root->outputs->length,
347 "cannot auto-assign output for layer")) { 347 "cannot auto-assign output for layer")) {
348 wlr_layer_surface_close(layer_surface); 348 wlr_layer_surface_v1_close(layer_surface);
349 return; 349 return;
350 } 350 }
351 output = root->outputs->items[0]; 351 output = root->outputs->items[0];
@@ -382,7 +382,7 @@ void handle_layer_shell_surface(struct wl_listener *listener, void *data) {
382 382
383 // Temporarily set the layer's current state to client_pending 383 // Temporarily set the layer's current state to client_pending
384 // So that we can easily arrange it 384 // So that we can easily arrange it
385 struct wlr_layer_surface_state old_state = layer_surface->current; 385 struct wlr_layer_surface_v1_state old_state = layer_surface->current;
386 layer_surface->current = layer_surface->client_pending; 386 layer_surface->current = layer_surface->client_pending;
387 arrange_layers(output); 387 arrange_layers(output);
388 layer_surface->current = old_state; 388 layer_surface->current = old_state;