From d4e80cf301d77f69370cc81657c433990986cfa6 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Tue, 11 Sep 2018 16:56:05 +1000 Subject: Rename OP_MOVE to OP_MOVE_FLOATING In preparation for introducing OP_MOVE_TILING. --- include/sway/input/seat.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/sway') diff --git a/include/sway/input/seat.h b/include/sway/input/seat.h index b07d200d..1ae34be5 100644 --- a/include/sway/input/seat.h +++ b/include/sway/input/seat.h @@ -38,7 +38,7 @@ struct sway_drag_icon { enum sway_seat_operation { OP_NONE, OP_DOWN, - OP_MOVE, + OP_MOVE_FLOATING, OP_RESIZE_FLOATING, OP_RESIZE_TILING, }; @@ -172,8 +172,8 @@ void drag_icon_update_position(struct sway_drag_icon *icon); void seat_begin_down(struct sway_seat *seat, struct sway_container *con, uint32_t button, double sx, double sy); -void seat_begin_move(struct sway_seat *seat, struct sway_container *con, - uint32_t button); +void seat_begin_move_floating(struct sway_seat *seat, + struct sway_container *con, uint32_t button); void seat_begin_resize_floating(struct sway_seat *seat, struct sway_container *con, uint32_t button, enum wlr_edges edge); -- cgit v1.2.3 From ec9c4de564286d3795dd204e2c0a69b10f7572be Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Tue, 11 Sep 2018 17:17:19 +1000 Subject: Introduce tiling_drag directive --- include/sway/commands.h | 1 + include/sway/config.h | 1 + 2 files changed, 2 insertions(+) (limited to 'include/sway') diff --git a/include/sway/commands.h b/include/sway/commands.h index b0b5ed0f..e51b12fd 100644 --- a/include/sway/commands.h +++ b/include/sway/commands.h @@ -161,6 +161,7 @@ sway_cmd cmd_sticky; sway_cmd cmd_swaybg_command; sway_cmd cmd_swaynag_command; sway_cmd cmd_swap; +sway_cmd cmd_tiling_drag; sway_cmd cmd_title_format; sway_cmd cmd_unmark; sway_cmd cmd_urgent; diff --git a/include/sway/config.h b/include/sway/config.h index b52bb681..b53c1f1f 100644 --- a/include/sway/config.h +++ b/include/sway/config.h @@ -365,6 +365,7 @@ struct sway_config { bool validating; bool auto_back_and_forth; bool show_marks; + bool tiling_drag; bool edge_gaps; bool smart_gaps; -- cgit v1.2.3 From 8bb40c24c7b045df0d43e9f22c096d1473f6f9f6 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Tue, 11 Sep 2018 21:34:21 +1000 Subject: Implement tiling drag Hold floating_modifier and drag a tiling view to a new location. --- include/sway/input/seat.h | 7 +++++++ include/sway/tree/container.h | 5 ++++- include/sway/tree/workspace.h | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-) (limited to 'include/sway') diff --git a/include/sway/input/seat.h b/include/sway/input/seat.h index 1ae34be5..e006faba 100644 --- a/include/sway/input/seat.h +++ b/include/sway/input/seat.h @@ -39,6 +39,7 @@ enum sway_seat_operation { OP_NONE, OP_DOWN, OP_MOVE_FLOATING, + OP_MOVE_TILING, OP_RESIZE_FLOATING, OP_RESIZE_TILING, }; @@ -64,6 +65,9 @@ struct sway_seat { // Operations (drag and resize) enum sway_seat_operation operation; struct sway_container *op_container; + struct sway_node *op_target_node; // target for tiling move + enum wlr_edges op_target_edge; + struct wlr_box op_drop_box; enum wlr_edges op_resize_edge; uint32_t op_button; bool op_resize_preserve_ratio; @@ -175,6 +179,9 @@ void seat_begin_down(struct sway_seat *seat, struct sway_container *con, void seat_begin_move_floating(struct sway_seat *seat, struct sway_container *con, uint32_t button); +void seat_begin_move_tiling(struct sway_seat *seat, + struct sway_container *con, uint32_t button); + void seat_begin_resize_floating(struct sway_seat *seat, struct sway_container *con, uint32_t button, enum wlr_edges edge); diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h index 2735daa3..94d30ced 100644 --- a/include/sway/tree/container.h +++ b/include/sway/tree/container.h @@ -279,8 +279,11 @@ void container_add_child(struct sway_container *parent, void container_insert_child(struct sway_container *parent, struct sway_container *child, int i); +/** + * Side should be 0 to add before, or 1 to add after. + */ void container_add_sibling(struct sway_container *parent, - struct sway_container *child); + struct sway_container *child, int side); void container_detach(struct sway_container *child); diff --git a/include/sway/tree/workspace.h b/include/sway/tree/workspace.h index af9a071a..e4b616d1 100644 --- a/include/sway/tree/workspace.h +++ b/include/sway/tree/workspace.h @@ -126,4 +126,6 @@ void workspace_update_representation(struct sway_workspace *ws); void workspace_get_box(struct sway_workspace *workspace, struct wlr_box *box); +size_t workspace_num_tiling_views(struct sway_workspace *ws); + #endif -- cgit v1.2.3 From 679c7eb08c16daea8e3e1cff7bcf179e116d0e8e Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Wed, 12 Sep 2018 08:46:46 +1000 Subject: Minor fixes to tiling drag implementation * Make container_add_sibling's `after` argument a boolean. * Use a constant for drop layout border * Make thickness an int * Add button state check * Move comments in seat_end_move_tiling --- include/sway/tree/container.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/sway') diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h index 94d30ced..5e281a2f 100644 --- a/include/sway/tree/container.h +++ b/include/sway/tree/container.h @@ -283,7 +283,7 @@ void container_insert_child(struct sway_container *parent, * Side should be 0 to add before, or 1 to add after. */ void container_add_sibling(struct sway_container *parent, - struct sway_container *child, int side); + struct sway_container *child, bool after); void container_detach(struct sway_container *child); -- cgit v1.2.3