mirror of
https://github.com/swaywm/sway.git
synced 2025-11-04 13:29:52 -05:00
Implement tiling drag
Hold floating_modifier and drag a tiling view to a new location.
This commit is contained in:
parent
ec9c4de564
commit
8bb40c24c7
10 changed files with 274 additions and 6 deletions
|
|
@ -835,8 +835,14 @@ void container_end_mouse_operation(struct sway_container *container) {
|
|||
struct sway_seat *seat;
|
||||
wl_list_for_each(seat, &input_manager->seats, link) {
|
||||
if (seat->op_container == container) {
|
||||
seat->op_target_node = NULL; // ensure tiling move doesn't apply
|
||||
seat_end_mouse_operation(seat);
|
||||
}
|
||||
// If the user is doing a tiling drag over this container,
|
||||
// keep the operation active but unset the target container.
|
||||
if (seat->op_target_node == &container->node) {
|
||||
seat->op_target_node = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1086,13 +1092,13 @@ void container_insert_child(struct sway_container *parent,
|
|||
}
|
||||
|
||||
void container_add_sibling(struct sway_container *fixed,
|
||||
struct sway_container *active) {
|
||||
struct sway_container *active, int side) {
|
||||
if (active->workspace) {
|
||||
container_detach(active);
|
||||
}
|
||||
list_t *siblings = container_get_siblings(fixed);
|
||||
int index = list_find(siblings, fixed);
|
||||
list_insert(siblings, index + 1, active);
|
||||
list_insert(siblings, index + side, active);
|
||||
active->parent = fixed->parent;
|
||||
active->workspace = fixed->workspace;
|
||||
container_for_each_child(active, set_workspace, NULL);
|
||||
|
|
@ -1145,7 +1151,7 @@ void container_detach(struct sway_container *child) {
|
|||
|
||||
void container_replace(struct sway_container *container,
|
||||
struct sway_container *replacement) {
|
||||
container_add_sibling(container, replacement);
|
||||
container_add_sibling(container, replacement, 1);
|
||||
container_detach(container);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue