diff options
-rw-r--r-- | include/sway/tree/container.h | 1 | ||||
-rw-r--r-- | sway/commands/floating.c | 13 | ||||
-rw-r--r-- | sway/debug-tree.c | 2 | ||||
-rw-r--r-- | sway/ipc-json.c | 2 |
4 files changed, 13 insertions, 5 deletions
diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h index fa2f9286..a4ffd25b 100644 --- a/include/sway/tree/container.h +++ b/include/sway/tree/container.h | |||
@@ -40,7 +40,6 @@ enum sway_container_layout { | |||
40 | L_VERT, | 40 | L_VERT, |
41 | L_STACKED, | 41 | L_STACKED, |
42 | L_TABBED, | 42 | L_TABBED, |
43 | L_FLOATING, | ||
44 | }; | 43 | }; |
45 | 44 | ||
46 | enum sway_container_border { | 45 | enum sway_container_border { |
diff --git a/sway/commands/floating.c b/sway/commands/floating.c index 8432b0dc..9e0be9d0 100644 --- a/sway/commands/floating.c +++ b/sway/commands/floating.c | |||
@@ -3,9 +3,11 @@ | |||
3 | #include "sway/commands.h" | 3 | #include "sway/commands.h" |
4 | #include "sway/input/seat.h" | 4 | #include "sway/input/seat.h" |
5 | #include "sway/ipc-server.h" | 5 | #include "sway/ipc-server.h" |
6 | #include "sway/output.h" | ||
6 | #include "sway/tree/arrange.h" | 7 | #include "sway/tree/arrange.h" |
7 | #include "sway/tree/container.h" | 8 | #include "sway/tree/container.h" |
8 | #include "sway/tree/layout.h" | 9 | #include "sway/tree/layout.h" |
10 | #include "sway/tree/view.h" | ||
9 | #include "list.h" | 11 | #include "list.h" |
10 | 12 | ||
11 | struct cmd_results *cmd_floating(int argc, char **argv) { | 13 | struct cmd_results *cmd_floating(int argc, char **argv) { |
@@ -38,6 +40,17 @@ struct cmd_results *cmd_floating(int argc, char **argv) { | |||
38 | container, C_WORKSPACE); | 40 | container, C_WORKSPACE); |
39 | container_remove_child(container); | 41 | container_remove_child(container); |
40 | container_add_floating(workspace, container); | 42 | container_add_floating(workspace, container); |
43 | |||
44 | struct sway_output *output = workspace->parent->sway_output; | ||
45 | output_damage_whole_container(output, container); | ||
46 | // Reset to sane size and position | ||
47 | container->width = 640; | ||
48 | container->height = 480; | ||
49 | container->x = workspace->width / 2 - container->width / 2; | ||
50 | container->y = workspace->height / 2 - container->height / 2; | ||
51 | view_autoconfigure(container->sway_view); | ||
52 | output_damage_whole_container(output, container); | ||
53 | |||
41 | seat_set_focus(config->handler_context.seat, container); | 54 | seat_set_focus(config->handler_context.seat, container); |
42 | arrange_workspace(workspace); | 55 | arrange_workspace(workspace); |
43 | } else if (container->is_floating && !wants_floating) { | 56 | } else if (container->is_floating && !wants_floating) { |
diff --git a/sway/debug-tree.c b/sway/debug-tree.c index ae0a1869..5af5b565 100644 --- a/sway/debug-tree.c +++ b/sway/debug-tree.c | |||
@@ -22,8 +22,6 @@ static const char *layout_to_str(enum sway_container_layout layout) { | |||
22 | return "L_STACKED"; | 22 | return "L_STACKED"; |
23 | case L_TABBED: | 23 | case L_TABBED: |
24 | return "L_TABBED"; | 24 | return "L_TABBED"; |
25 | case L_FLOATING: | ||
26 | return "L_FLOATING"; | ||
27 | case L_NONE: | 25 | case L_NONE: |
28 | default: | 26 | default: |
29 | return "L_NONE"; | 27 | return "L_NONE"; |
diff --git a/sway/ipc-json.c b/sway/ipc-json.c index 03582950..da4bef60 100644 --- a/sway/ipc-json.c +++ b/sway/ipc-json.c | |||
@@ -21,8 +21,6 @@ static const char *ipc_json_layout_description(enum sway_container_layout l) { | |||
21 | return "tabbed"; | 21 | return "tabbed"; |
22 | case L_STACKED: | 22 | case L_STACKED: |
23 | return "stacked"; | 23 | return "stacked"; |
24 | case L_FLOATING: | ||
25 | return "floating"; | ||
26 | case L_NONE: | 24 | case L_NONE: |
27 | break; | 25 | break; |
28 | } | 26 | } |