mirror of
https://github.com/swaywm/sway.git
synced 2024-12-30 17:06:40 +01:00
choose adjacent container between outputs
This commit is contained in:
parent
fb37e80225
commit
176d24f02d
1 changed files with 14 additions and 8 deletions
|
@ -364,7 +364,12 @@ static swayc_t *get_swayc_in_output_direction(swayc_t *output,
|
||||||
ws = swayc_parent_by_type(ws, C_WORKSPACE);
|
ws = swayc_parent_by_type(ws, C_WORKSPACE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ws && ws->children->length > 0) {
|
if (ws == NULL) {
|
||||||
|
wlr_log(L_ERROR, "got an output without a workspace");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ws->children->length > 0) {
|
||||||
switch (dir) {
|
switch (dir) {
|
||||||
case MOVE_LEFT:
|
case MOVE_LEFT:
|
||||||
// get most right child of new output
|
// get most right child of new output
|
||||||
|
@ -395,7 +400,7 @@ static swayc_t *get_swayc_in_output_direction(swayc_t *output,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return output;
|
return ws;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void get_layout_center_position(swayc_t *container, int *x, int *y) {
|
static void get_layout_center_position(swayc_t *container, int *x, int *y) {
|
||||||
|
@ -525,12 +530,13 @@ static swayc_t *get_swayc_in_direction_under(swayc_t *container,
|
||||||
if (!adjacent || adjacent == container) {
|
if (!adjacent || adjacent == container) {
|
||||||
return wrap_candidate;
|
return wrap_candidate;
|
||||||
}
|
}
|
||||||
// TODO descend into the focus-inactive of the physically closest
|
swayc_t *next = get_swayc_in_output_direction(adjacent, dir, seat);
|
||||||
// view of the output
|
if (next->children->length) {
|
||||||
//swayc_t *new_con = get_swayc_in_output_direction(adjacent, dir, seat);
|
// TODO consider floating children as well
|
||||||
swayc_t *new_con = sway_seat_get_focus_inactive(seat, adjacent);
|
return sway_seat_get_focus_inactive(seat, next);
|
||||||
return new_con;
|
} else {
|
||||||
|
return next;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (dir == MOVE_LEFT || dir == MOVE_RIGHT) {
|
if (dir == MOVE_LEFT || dir == MOVE_RIGHT) {
|
||||||
if (parent->layout == L_HORIZ || parent->layout == L_TABBED) {
|
if (parent->layout == L_HORIZ || parent->layout == L_TABBED) {
|
||||||
|
|
Loading…
Reference in a new issue