diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-03-31 21:21:26 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2018-04-02 11:12:18 -0400 |
commit | b2d871cfe215a82266d01847f4787bbcf8c721c9 (patch) | |
tree | 87dbae47c65d56730c816d7e6e2123e5e851dec2 /include | |
parent | Merge pull request #1684 from swaywm/follow-warp (diff) | |
download | sway-b2d871cfe215a82266d01847f4787bbcf8c721c9.tar.gz sway-b2d871cfe215a82266d01847f4787bbcf8c721c9.tar.zst sway-b2d871cfe215a82266d01847f4787bbcf8c721c9.zip |
Partially implement move command
Works:
- move [container|window] to workspace <name>
- Note, this should be able to move C_CONTAINER but this is untested
- move [workspace] to output [left|right|up|down|<name>]
Not implemented yet:
- move [left|right|up|down]
- move scratchpad
- move position
Diffstat (limited to 'include')
-rw-r--r-- | include/sway/output.h | 2 | ||||
-rw-r--r-- | include/sway/tree/container.h | 5 | ||||
-rw-r--r-- | include/sway/tree/layout.h | 12 |
3 files changed, 14 insertions, 5 deletions
diff --git a/include/sway/output.h b/include/sway/output.h index b4980cd8..b343ecff 100644 --- a/include/sway/output.h +++ b/include/sway/output.h | |||
@@ -36,4 +36,6 @@ void output_damage_whole(struct sway_output *output); | |||
36 | void output_damage_whole_view(struct sway_output *output, | 36 | void output_damage_whole_view(struct sway_output *output, |
37 | struct sway_view *view); | 37 | struct sway_view *view); |
38 | 38 | ||
39 | struct sway_container *output_by_name(const char *name); | ||
40 | |||
39 | #endif | 41 | #endif |
diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h index 6aa66da0..aff2e58e 100644 --- a/include/sway/tree/container.h +++ b/include/sway/tree/container.h | |||
@@ -84,9 +84,14 @@ struct sway_container { | |||
84 | 84 | ||
85 | struct { | 85 | struct { |
86 | struct wl_signal destroy; | 86 | struct wl_signal destroy; |
87 | // Raised after the tree updates, but before arrange_windows | ||
88 | // Passed the previous parent | ||
89 | struct wl_signal reparent; | ||
87 | } events; | 90 | } events; |
88 | }; | 91 | }; |
89 | 92 | ||
93 | const char *container_type_to_str(enum sway_container_type type); | ||
94 | |||
90 | // TODO only one container create function and pass the type? | 95 | // TODO only one container create function and pass the type? |
91 | struct sway_container *container_output_create( | 96 | struct sway_container *container_output_create( |
92 | struct sway_output *sway_output); | 97 | struct sway_output *sway_output); |
diff --git a/include/sway/tree/layout.h b/include/sway/tree/layout.h index 0a904c4b..e1034657 100644 --- a/include/sway/tree/layout.h +++ b/include/sway/tree/layout.h | |||
@@ -11,9 +11,6 @@ enum movement_direction { | |||
11 | MOVE_DOWN, | 11 | MOVE_DOWN, |
12 | MOVE_PARENT, | 12 | MOVE_PARENT, |
13 | MOVE_CHILD, | 13 | MOVE_CHILD, |
14 | MOVE_NEXT, | ||
15 | MOVE_PREV, | ||
16 | MOVE_FIRST | ||
17 | }; | 14 | }; |
18 | 15 | ||
19 | struct sway_container; | 16 | struct sway_container; |
@@ -32,7 +29,8 @@ struct sway_root { | |||
32 | 29 | ||
33 | void layout_init(void); | 30 | void layout_init(void); |
34 | 31 | ||
35 | void container_add_child(struct sway_container *parent, struct sway_container *child); | 32 | void container_add_child(struct sway_container *parent, |
33 | struct sway_container *child); | ||
36 | 34 | ||
37 | struct sway_container *container_add_sibling(struct sway_container *parent, | 35 | struct sway_container *container_add_sibling(struct sway_container *parent, |
38 | struct sway_container *child); | 36 | struct sway_container *child); |
@@ -44,7 +42,11 @@ struct sway_container *container_reap_empty(struct sway_container *container); | |||
44 | void container_move_to(struct sway_container* container, | 42 | void container_move_to(struct sway_container* container, |
45 | struct sway_container* destination); | 43 | struct sway_container* destination); |
46 | 44 | ||
47 | enum sway_container_layout container_get_default_layout(struct sway_container *output); | 45 | void container_move(struct sway_container *container, |
46 | enum movement_direction dir, int move_amt); | ||
47 | |||
48 | enum sway_container_layout container_get_default_layout( | ||
49 | struct sway_container *output); | ||
48 | 50 | ||
49 | void container_sort_workspaces(struct sway_container *output); | 51 | void container_sort_workspaces(struct sway_container *output); |
50 | 52 | ||