diff options
author | Alexander Orzechowski <orzechowski.alexander@gmail.com> | 2022-03-01 16:19:23 -0500 |
---|---|---|
committer | Kirill Primak <vyivel@eclair.cafe> | 2024-01-18 18:36:54 +0300 |
commit | b4d7e84d3852ea93d2aab22f5993f84a7060b950 (patch) | |
tree | b3b3e32af7044e3af6679482a861e650e20eed62 /sway/desktop | |
parent | layer-shell: don't configure uninitialized surfaces (diff) | |
download | sway-b4d7e84d3852ea93d2aab22f5993f84a7060b950.tar.gz sway-b4d7e84d3852ea93d2aab22f5993f84a7060b950.tar.zst sway-b4d7e84d3852ea93d2aab22f5993f84a7060b950.zip |
desktop: Rename layers to shell_layers
This code will be deleted later, but for the time being rename
it so it doesn't conflict with future properties.
Diffstat (limited to 'sway/desktop')
-rw-r--r-- | sway/desktop/layer_shell.c | 27 | ||||
-rw-r--r-- | sway/desktop/output.c | 12 | ||||
-rw-r--r-- | sway/desktop/render.c | 16 |
3 files changed, 27 insertions, 28 deletions
diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c index e5e7046a..6480d7ce 100644 --- a/sway/desktop/layer_shell.c +++ b/sway/desktop/layer_shell.c | |||
@@ -218,13 +218,13 @@ void arrange_layers(struct sway_output *output) { | |||
218 | &usable_area.width, &usable_area.height); | 218 | &usable_area.width, &usable_area.height); |
219 | 219 | ||
220 | // Arrange exclusive surfaces from top->bottom | 220 | // Arrange exclusive surfaces from top->bottom |
221 | arrange_layer(output, &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY], | 221 | arrange_layer(output, &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY], |
222 | &usable_area, true); | 222 | &usable_area, true); |
223 | arrange_layer(output, &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP], | 223 | arrange_layer(output, &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP], |
224 | &usable_area, true); | 224 | &usable_area, true); |
225 | arrange_layer(output, &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM], | 225 | arrange_layer(output, &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM], |
226 | &usable_area, true); | 226 | &usable_area, true); |
227 | arrange_layer(output, &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND], | 227 | arrange_layer(output, &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND], |
228 | &usable_area, true); | 228 | &usable_area, true); |
229 | 229 | ||
230 | if (memcmp(&usable_area, &output->usable_area, | 230 | if (memcmp(&usable_area, &output->usable_area, |
@@ -235,13 +235,13 @@ void arrange_layers(struct sway_output *output) { | |||
235 | } | 235 | } |
236 | 236 | ||
237 | // Arrange non-exclusive surfaces from top->bottom | 237 | // Arrange non-exclusive surfaces from top->bottom |
238 | arrange_layer(output, &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY], | 238 | arrange_layer(output, &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY], |
239 | &usable_area, false); | 239 | &usable_area, false); |
240 | arrange_layer(output, &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP], | 240 | arrange_layer(output, &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP], |
241 | &usable_area, false); | 241 | &usable_area, false); |
242 | arrange_layer(output, &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM], | 242 | arrange_layer(output, &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM], |
243 | &usable_area, false); | 243 | &usable_area, false); |
244 | arrange_layer(output, &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND], | 244 | arrange_layer(output, &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND], |
245 | &usable_area, false); | 245 | &usable_area, false); |
246 | 246 | ||
247 | // Find topmost keyboard interactive layer, if such a layer exists | 247 | // Find topmost keyboard interactive layer, if such a layer exists |
@@ -253,9 +253,8 @@ void arrange_layers(struct sway_output *output) { | |||
253 | struct sway_layer_surface *layer, *topmost = NULL; | 253 | struct sway_layer_surface *layer, *topmost = NULL; |
254 | for (size_t i = 0; i < nlayers; ++i) { | 254 | for (size_t i = 0; i < nlayers; ++i) { |
255 | wl_list_for_each_reverse(layer, | 255 | wl_list_for_each_reverse(layer, |
256 | &output->layers[layers_above_shell[i]], link) { | 256 | &output->shell_layers[layers_above_shell[i]], link) { |
257 | if (layer->layer_surface->current.keyboard_interactive | 257 | if (layer->layer_surface->current.keyboard_interactive && |
258 | == ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_EXCLUSIVE && | ||
259 | layer->layer_surface->surface->mapped) { | 258 | layer->layer_surface->surface->mapped) { |
260 | topmost = layer; | 259 | topmost = layer; |
261 | break; | 260 | break; |
@@ -289,7 +288,7 @@ static struct sway_layer_surface *find_mapped_layer_by_client( | |||
289 | // For now we'll only check the overlay layer | 288 | // For now we'll only check the overlay layer |
290 | struct sway_layer_surface *lsurface; | 289 | struct sway_layer_surface *lsurface; |
291 | wl_list_for_each(lsurface, | 290 | wl_list_for_each(lsurface, |
292 | &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY], link) { | 291 | &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY], link) { |
293 | struct wl_resource *resource = lsurface->layer_surface->resource; | 292 | struct wl_resource *resource = lsurface->layer_surface->resource; |
294 | if (wl_resource_get_client(resource) == client | 293 | if (wl_resource_get_client(resource) == client |
295 | && lsurface->layer_surface->surface->mapped) { | 294 | && lsurface->layer_surface->surface->mapped) { |
@@ -343,7 +342,7 @@ static void handle_surface_commit(struct wl_listener *listener, void *data) { | |||
343 | layer_changed = layer->layer != layer_surface->current.layer; | 342 | layer_changed = layer->layer != layer_surface->current.layer; |
344 | if (layer_changed) { | 343 | if (layer_changed) { |
345 | wl_list_remove(&layer->link); | 344 | wl_list_remove(&layer->link); |
346 | wl_list_insert(&output->layers[layer_surface->current.layer], | 345 | wl_list_insert(&output->shell_layers[layer_surface->current.layer], |
347 | &layer->link); | 346 | &layer->link); |
348 | layer->layer = layer_surface->current.layer; | 347 | layer->layer = layer_surface->current.layer; |
349 | } | 348 | } |
@@ -716,6 +715,6 @@ void handle_layer_shell_surface(struct wl_listener *listener, void *data) { | |||
716 | sway_layer->output_destroy.notify = handle_output_destroy; | 715 | sway_layer->output_destroy.notify = handle_output_destroy; |
717 | wl_signal_add(&output->events.disable, &sway_layer->output_destroy); | 716 | wl_signal_add(&output->events.disable, &sway_layer->output_destroy); |
718 | 717 | ||
719 | wl_list_insert(&output->layers[layer_surface->pending.layer], | 718 | wl_list_insert(&output->shell_layers[layer_surface->pending.layer], |
720 | &sway_layer->link); | 719 | &sway_layer->link); |
721 | } | 720 | } |
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index 8b84da86..928c77d6 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c | |||
@@ -347,10 +347,10 @@ static void output_for_each_surface(struct sway_output *output, | |||
347 | #endif | 347 | #endif |
348 | } else { | 348 | } else { |
349 | output_layer_for_each_surface(output, | 349 | output_layer_for_each_surface(output, |
350 | &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND], | 350 | &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND], |
351 | iterator, user_data); | 351 | iterator, user_data); |
352 | output_layer_for_each_surface(output, | 352 | output_layer_for_each_surface(output, |
353 | &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM], | 353 | &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM], |
354 | iterator, user_data); | 354 | iterator, user_data); |
355 | 355 | ||
356 | workspace_for_each_container(workspace, | 356 | workspace_for_each_container(workspace, |
@@ -361,13 +361,13 @@ static void output_for_each_surface(struct sway_output *output, | |||
361 | iterator, user_data); | 361 | iterator, user_data); |
362 | #endif | 362 | #endif |
363 | output_layer_for_each_surface(output, | 363 | output_layer_for_each_surface(output, |
364 | &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP], | 364 | &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP], |
365 | iterator, user_data); | 365 | iterator, user_data); |
366 | } | 366 | } |
367 | 367 | ||
368 | overlay: | 368 | overlay: |
369 | output_layer_for_each_surface(output, | 369 | output_layer_for_each_surface(output, |
370 | &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY], | 370 | &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY], |
371 | iterator, user_data); | 371 | iterator, user_data); |
372 | output_drag_icons_for_each_surface(output, &root->drag_icons, | 372 | output_drag_icons_for_each_surface(output, &root->drag_icons, |
373 | iterator, user_data); | 373 | iterator, user_data); |
@@ -399,7 +399,7 @@ struct sway_workspace *output_get_active_workspace(struct sway_output *output) { | |||
399 | bool output_has_opaque_overlay_layer_surface(struct sway_output *output) { | 399 | bool output_has_opaque_overlay_layer_surface(struct sway_output *output) { |
400 | struct sway_layer_surface *sway_layer_surface; | 400 | struct sway_layer_surface *sway_layer_surface; |
401 | wl_list_for_each(sway_layer_surface, | 401 | wl_list_for_each(sway_layer_surface, |
402 | &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY], link) { | 402 | &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY], link) { |
403 | struct wlr_surface *wlr_surface = sway_layer_surface->layer_surface->surface; | 403 | struct wlr_surface *wlr_surface = sway_layer_surface->layer_surface->surface; |
404 | pixman_box32_t output_box = { | 404 | pixman_box32_t output_box = { |
405 | .x2 = output->width, | 405 | .x2 = output->width, |
@@ -488,7 +488,7 @@ static bool scan_out_fullscreen_view(struct sway_output *output, | |||
488 | } | 488 | } |
489 | #endif | 489 | #endif |
490 | 490 | ||
491 | if (!wl_list_empty(&output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY])) { | 491 | if (!wl_list_empty(&output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY])) { |
492 | return false; | 492 | return false; |
493 | } | 493 | } |
494 | if (!wl_list_empty(&root->drag_icons)) { | 494 | if (!wl_list_empty(&root->drag_icons)) { |
diff --git a/sway/desktop/render.c b/sway/desktop/render.c index c9a306cf..168c941b 100644 --- a/sway/desktop/render.c +++ b/sway/desktop/render.c | |||
@@ -1098,9 +1098,9 @@ void output_render(struct render_context *ctx) { | |||
1098 | }); | 1098 | }); |
1099 | 1099 | ||
1100 | render_layer_toplevel(ctx, | 1100 | render_layer_toplevel(ctx, |
1101 | &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND]); | 1101 | &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND]); |
1102 | render_layer_toplevel(ctx, | 1102 | render_layer_toplevel(ctx, |
1103 | &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM]); | 1103 | &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM]); |
1104 | 1104 | ||
1105 | render_workspace(ctx, workspace, workspace->current.focused); | 1105 | render_workspace(ctx, workspace, workspace->current.focused); |
1106 | render_floating(ctx); | 1106 | render_floating(ctx); |
@@ -1108,14 +1108,14 @@ void output_render(struct render_context *ctx) { | |||
1108 | render_unmanaged(ctx, &root->xwayland_unmanaged); | 1108 | render_unmanaged(ctx, &root->xwayland_unmanaged); |
1109 | #endif | 1109 | #endif |
1110 | render_layer_toplevel(ctx, | 1110 | render_layer_toplevel(ctx, |
1111 | &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP]); | 1111 | &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP]); |
1112 | 1112 | ||
1113 | render_layer_popups(ctx, | 1113 | render_layer_popups(ctx, |
1114 | &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND]); | 1114 | &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND]); |
1115 | render_layer_popups(ctx, | 1115 | render_layer_popups(ctx, |
1116 | &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM]); | 1116 | &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM]); |
1117 | render_layer_popups(ctx, | 1117 | render_layer_popups(ctx, |
1118 | &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP]); | 1118 | &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP]); |
1119 | } | 1119 | } |
1120 | 1120 | ||
1121 | render_seatops(ctx); | 1121 | render_seatops(ctx); |
@@ -1128,9 +1128,9 @@ void output_render(struct render_context *ctx) { | |||
1128 | 1128 | ||
1129 | render_overlay: | 1129 | render_overlay: |
1130 | render_layer_toplevel(ctx, | 1130 | render_layer_toplevel(ctx, |
1131 | &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY]); | 1131 | &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY]); |
1132 | render_layer_popups(ctx, | 1132 | render_layer_popups(ctx, |
1133 | &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY]); | 1133 | &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY]); |
1134 | render_drag_icons(ctx, &root->drag_icons); | 1134 | render_drag_icons(ctx, &root->drag_icons); |
1135 | 1135 | ||
1136 | renderer_end: | 1136 | renderer_end: |