Skip to content

layer-shell: chase wlr layer surface refactor #6528

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 23, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions sway/desktop/layer_shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -598,14 +598,14 @@ void handle_layer_shell_surface(struct wl_listener *listener, void *data) {
sway_log(SWAY_DEBUG, "new layer surface: namespace %s layer %d anchor %" PRIu32
" size %" PRIu32 "x%" PRIu32 " margin %" PRIu32 ",%" PRIu32 ",%" PRIu32 ",%" PRIu32 ",",
layer_surface->namespace,
layer_surface->client_pending.layer,
layer_surface->client_pending.anchor,
layer_surface->client_pending.desired_width,
layer_surface->client_pending.desired_height,
layer_surface->client_pending.margin.top,
layer_surface->client_pending.margin.right,
layer_surface->client_pending.margin.bottom,
layer_surface->client_pending.margin.left);
layer_surface->pending.layer,
layer_surface->pending.anchor,
layer_surface->pending.desired_width,
layer_surface->pending.desired_height,
layer_surface->pending.margin.top,
layer_surface->pending.margin.right,
layer_surface->pending.margin.bottom,
layer_surface->pending.margin.left);

if (!layer_surface->output) {
// Assign last active output
Expand Down Expand Up @@ -659,13 +659,13 @@ void handle_layer_shell_surface(struct wl_listener *listener, void *data) {
sway_layer->output_destroy.notify = handle_output_destroy;
wl_signal_add(&output->events.destroy, &sway_layer->output_destroy);

wl_list_insert(&output->layers[layer_surface->client_pending.layer],
wl_list_insert(&output->layers[layer_surface->pending.layer],
&sway_layer->link);

// Temporarily set the layer's current state to client_pending
// Temporarily set the layer's current state to pending
// So that we can easily arrange it
struct wlr_layer_surface_v1_state old_state = layer_surface->current;
layer_surface->current = layer_surface->client_pending;
layer_surface->current = layer_surface->pending;
Copy link
Member Author

@vyivel vyivel Sep 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated, but that's a hack and which might stop working once swaywm/wlroots#3151 is merged.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh, yeah, that isn't great. We should definitely fix it, maybe by passing a "configuring" layer surface to arrange_layers. Also arrange_layers shouldn't actually update the positions of the other layers just yet… We should wait for ack_configure.

Oh well.

arrange_layers(output);
layer_surface->current = old_state;
}