diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-08-19 15:07:07 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-08-19 16:18:33 +1000 |
commit | 2b5a404ac920339a2b9ce32d4718272dee4668b9 (patch) | |
tree | 681f45a530a1f8d5966161291c3cb482e52edb6e /sway/desktop/output.c | |
parent | Merge pull request #2453 from ianyfan/commands (diff) | |
download | sway-2b5a404ac920339a2b9ce32d4718272dee4668b9.tar.gz sway-2b5a404ac920339a2b9ce32d4718272dee4668b9.tar.zst sway-2b5a404ac920339a2b9ce32d4718272dee4668b9.zip |
Replace hacky L_FLOATING container with a list
Workspaces previously had a magical `workspace->floating` container,
which had a layout of L_FLOATING and whose children were actual floating
views. This allowed some conveniences, but was a hacky solution because
the container has to be exempt from focus, coordinate transactions with
the workspace, and omit emitting IPC events (which we didn't do).
This commit changes it to be a list directly in the sway_workspace. The
L_FLOATING layout is no longer used so this has been removed as well.
* Fixes incorrect check in the swap command (it checked if the
containers had the L_FLOATING layout, but this layout applied to the
magical container).
* Introduces workspace_add_floating
Diffstat (limited to 'sway/desktop/output.c')
-rw-r--r-- | sway/desktop/output.c | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index 1e4f196b..2253eb51 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c | |||
@@ -316,31 +316,21 @@ static void send_frame_done_container_iterator(struct sway_container *con, | |||
316 | send_frame_done_iterator, data->when); | 316 | send_frame_done_iterator, data->when); |
317 | } | 317 | } |
318 | 318 | ||
319 | static void send_frame_done_container(struct sway_output *output, | ||
320 | struct sway_container *con, struct timespec *when) { | ||
321 | struct send_frame_done_data data = { | ||
322 | .output = output, | ||
323 | .when = when, | ||
324 | }; | ||
325 | output_for_each_container(output->swayc, | ||
326 | send_frame_done_container_iterator, &data); | ||
327 | } | ||
328 | |||
329 | static void send_frame_done(struct sway_output *output, struct timespec *when) { | 319 | static void send_frame_done(struct sway_output *output, struct timespec *when) { |
330 | if (output_has_opaque_overlay_layer_surface(output)) { | 320 | if (output_has_opaque_overlay_layer_surface(output)) { |
331 | goto send_frame_overlay; | 321 | goto send_frame_overlay; |
332 | } | 322 | } |
333 | 323 | ||
324 | struct send_frame_done_data data = { | ||
325 | .output = output, | ||
326 | .when = when, | ||
327 | }; | ||
334 | struct sway_container *workspace = output_get_active_workspace(output); | 328 | struct sway_container *workspace = output_get_active_workspace(output); |
335 | if (workspace->current.ws_fullscreen) { | 329 | if (workspace->current.ws_fullscreen) { |
336 | if (workspace->current.ws_fullscreen->type == C_VIEW) { | 330 | send_frame_done_container_iterator( |
337 | output_view_for_each_surface(output, | 331 | workspace->current.ws_fullscreen, &data); |
338 | workspace->current.ws_fullscreen->sway_view, | 332 | container_for_each_child(workspace->current.ws_fullscreen, |
339 | send_frame_done_iterator, when); | 333 | send_frame_done_container_iterator, &data); |
340 | } else { | ||
341 | send_frame_done_container(output, workspace->current.ws_fullscreen, | ||
342 | when); | ||
343 | } | ||
344 | #ifdef HAVE_XWAYLAND | 334 | #ifdef HAVE_XWAYLAND |
345 | send_frame_done_unmanaged(output, | 335 | send_frame_done_unmanaged(output, |
346 | &root_container.sway_root->xwayland_unmanaged, when); | 336 | &root_container.sway_root->xwayland_unmanaged, when); |
@@ -351,9 +341,8 @@ static void send_frame_done(struct sway_output *output, struct timespec *when) { | |||
351 | send_frame_done_layer(output, | 341 | send_frame_done_layer(output, |
352 | &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM], when); | 342 | &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM], when); |
353 | 343 | ||
354 | send_frame_done_container(output, workspace, when); | 344 | workspace_for_each_container(workspace, |
355 | send_frame_done_container(output, workspace->sway_workspace->floating, | 345 | send_frame_done_container_iterator, &data); |
356 | when); | ||
357 | 346 | ||
358 | #ifdef HAVE_XWAYLAND | 347 | #ifdef HAVE_XWAYLAND |
359 | send_frame_done_unmanaged(output, | 348 | send_frame_done_unmanaged(output, |