mirror of
https://github.com/swaywm/sway.git
synced 2024-12-01 19:06:38 +00:00
Function to move floating containers
This commit is contained in:
parent
2530f952c9
commit
d2f0a1db94
|
@ -48,6 +48,7 @@ void swap_container(swayc_t *a, swayc_t *b);
|
||||||
// 2 Containers geometry are swapped, used with `swap_container`
|
// 2 Containers geometry are swapped, used with `swap_container`
|
||||||
void swap_geometry(swayc_t *a, swayc_t *b);
|
void swap_geometry(swayc_t *a, swayc_t *b);
|
||||||
|
|
||||||
|
void move_floating_container(swayc_t *container, int dx, int dy);
|
||||||
void move_container(swayc_t* container, enum movement_direction direction);
|
void move_container(swayc_t* container, enum movement_direction direction);
|
||||||
void move_container_to(swayc_t* container, swayc_t* destination);
|
void move_container_to(swayc_t* container, swayc_t* destination);
|
||||||
void move_workspace_to(swayc_t* workspace, swayc_t* destination);
|
void move_workspace_to(swayc_t* workspace, swayc_t* destination);
|
||||||
|
|
|
@ -226,6 +226,15 @@ void swap_geometry(swayc_t *a, swayc_t *b) {
|
||||||
b->height = h;
|
b->height = h;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void move_floating_container(swayc_t *container, int dx, int dy) {
|
||||||
|
if (!sway_assert(container->is_floating, "Container has to be floating")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
container->x += dx;
|
||||||
|
container->y += dy;
|
||||||
|
update_geometry(container);
|
||||||
|
}
|
||||||
|
|
||||||
void move_container(swayc_t *container, enum movement_direction dir) {
|
void move_container(swayc_t *container, enum movement_direction dir) {
|
||||||
enum swayc_layouts layout;
|
enum swayc_layouts layout;
|
||||||
if (container->is_floating
|
if (container->is_floating
|
||||||
|
|
Loading…
Reference in a new issue